Skip to content

test: verify sanitizer build configuration - #1716

Open
astandrik wants to merge 4 commits into
DeusData:mainfrom
astandrik:codex/fix-1648-sanitized-build-config
Open

test: verify sanitizer build configuration#1716
astandrik wants to merge 4 commits into
DeusData:mainfrom
astandrik:codex/fix-1648-sanitized-build-config

Conversation

@astandrik

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #1648 by checking what each test runner was actually compiled with.

test-runner --build-config exits before suite or test-cache setup and prints one exact line: sanitized=<0|1> test_seams=<0|1>. scripts/test.sh checks that line immediately after building the runner in its iteration, full, and TSan paths. scripts/msan.sh performs the same check before its suites start. If a stale or misconfigured runner disagrees with the lane, the script now stops before any suite can run with the wrong timing budget.

The patch only changes tests/test_main.c, scripts/test.sh, and scripts/msan.sh. It does not touch the Makefile, workflows, dependencies, or production code.

Checks run

  • Plain runner: sanitized=0 test_seams=1
  • Default and explicit UBSan runners: sanitized=1 test_seams=1
  • Empty and whitespace-only SANITIZE paths
  • Reused plain build followed by a default sanitized iteration, which failed at the new check before the suite
  • Full scripts/test.sh on Linux x86-64
  • bash -n scripts/test.sh scripts/msan.sh
  • git diff HEAD^ HEAD --check
  • Commit signature and DCO checks

Apple Silicon ASan and TSan fail in the sanitizer runtime before main, so they do not provide evidence about this patch. The remote MSan path is also blocked before its build command because the Compose service is pinned to linux/arm64 and the x86-64 builder has no binfmt/QEMU registration. Windows CLANG64/CLANGARM64 and the authoritative sanitizer lanes remain for CI.

Full lint reaches existing diagnostics in unchanged source files; none of the three files in this patch appears in that output.

Checklist

  • Every commit is signed off (git commit -s): CI requires DCO.
  • Tests pass locally (make -f Makefile.cbm test): the full Linux run passed remotely, while the Apple sanitizer runtime blocks the local default.
  • Lint passes (make -f Makefile.cbm lint-ci): the current baseline reports diagnostics in unchanged source files.
  • New behavior is covered by the test entrypoints and focused positive and stale-build checks.

@github-actions

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

Signed-off-by: astandrik <astandrik@yandex-team.ru>
Signed-off-by: astandrik <astandrik@yandex-team.ru>
@astandrik
astandrik force-pushed the codex/fix-1648-sanitized-build-config branch from 4619986 to ba0c499 Compare August 18, 2026 18:49
Signed-off-by: astandrik <astandrik@yandex-team.ru>
@astandrik
astandrik marked this pull request as ready for review August 19, 2026 12:19
@astandrik
astandrik requested a review from DeusData as a code owner August 19, 2026 12:19
Copilot AI lite review requested due to automatic review settings August 19, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an early “compiled build configuration” probe to the C test-runner binary and enforces it from the test entrypoint scripts, preventing suites from running when a stale/misconfigured runner doesn’t match the intended sanitizer lane.

Changes:

  • Add test-runner --build-config (early-exit) that prints sanitized=<0|1> test_seams=<0|1>.
  • In scripts/test.sh, assert the freshly-built runner reports the expected sanitized value before running any suites (iteration / full / TSan paths).
  • In scripts/msan.sh, assert the MSan runner reports the expected config before running its suites.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_main.c Adds --build-config output based on compile-time macros (CBM_SANITIZED, CBM_ENABLE_TEST_SEAMS).
scripts/test.sh Adds build-config assertion gate after building runners in each mode.
scripts/msan.sh Adds the same build-config assertion gate for the MSan runner before suites.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_main.c
Signed-off-by: astandrik <astandrik@yandex-team.ru>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread tests/test_main.c
Comment on lines +840 to +845
#if defined(CBM_ENABLE_TEST_SEAMS) && CBM_ENABLE_TEST_SEAMS
const int test_seams = 1;
#else
const int test_seams = 0;
#endif
(void)printf("sanitized=%d test_seams=%d\n", CBM_SANITIZED, test_seams);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing verifies that a sanitized lane actually compiled with CBM_SANITIZED_BUILD (UBSan and trap-UBSan have no probe)

2 participants