Skip to content

ci: fix the three repository checks that fail on main - #1673

Closed
xel1uz wants to merge 1 commit into
ProjectLeonida:mainfrom
xel1uz:fix/main-consistency-checks
Closed

xel1uz wants to merge 1 commit into
ProjectLeonida:mainfrom
xel1uz:fix/main-consistency-checks

Conversation

@xel1uz

@xel1uz xel1uz commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Item ID: CI-MAIN-CONSISTENCY, claimed in #1608 (#1608 (comment), done: #1608 (comment)). I posted the claim there after opening this PR, because I missed that #1608 had replaced the capped #14.

Claimed as: CI-MAIN-CONSISTENCY - the standard-library job fails on main (42537e7) for three reasons that have nothing to do with any open PR, so every fork that syncs main and every PR built on it inherits a red CI.

What and why

Three repository-consistency tests fail on main at 42537e7. They depend on no platform, GPU or Python version:

  1. tests/test_runner_calls_all_tests.py reports tests/test_feature_scan.py: test_out_named_like_the_optional_spirv_index() as a dead test. It is not dead: that file's __main__ runner passes every test_* to run_tests([fn for name, fn in list(globals().items()) ...]). The checker only followed for loops over globals(), so test_feature_scan.py kept a hand-written RUNNER_SKIPS list of each test, and the newest test was never added to it. Any new test in that file would break main the same way.
    Fix: dispatches_tests() now also accepts a list, set or generator comprehension over globals()/locals()/vars() that yields the loop variable straight into a call. The test_feature_scan.py entry in RUNNER_SKIPS is removed. A new bite check confirms that the runner counts as dispatching, and that the same comprehension over a fixed table still reports what it misses. The existing test_a_dropped_call_is_flagged bite check is unchanged and passes.
  2. tests/test_runtime_paths.py: runtime/CMakeLists.txt builds from tools/conformance/native/src (L2089-2091), but .github/workflows/runtime.yml does not list tools/conformance/**. tools/conformance/** is now added to both the push and pull_request path filters, in alphabetical order, so the two lists stay identical.
  3. tests/test_tool_stdout_encoding.py: tools/compute_heap_layout_census.py was the one CLI tool whose __main__ block did not start with sys.stdout.reconfigure(errors="replace"). It now has the same guard as tools/ab_control_flow.py and the rest.

Tested

  • At 42537e7: python -I tests/test_runner_calls_all_tests.py fails (1 failure). test_runtime_paths.py and test_tool_stdout_encoding.py each fail with the messages above.
  • With this branch: python -I tests/test_runner_calls_all_tests.py gives 4 tests OK, python -I tests/test_runtime_paths.py gives 5 OK, and python -I tests/test_tool_stdout_encoding.py gives 4 OK.
  • python -I tests/test_feature_scan.py: OK (0 failed checks, 0 failed tests). python -I tools/compute_heap_layout_census.py --help prints its usage.
  • git diff --check is clean. python3 -I scripts/check_no_game_data.py on the changed files is clean.

This does not touch the GPU jobs. The cs_imgatomic_ext failure on MoltenVK in Runtime is a separate issue.

GPUs tested: n/a - repository checks only.

AI-assisted: Yes.

Checklist

  • Based on current main (42537e7) and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption; synthetic inputs only.
  • A new translator rule in the contract table of docs/design.md - not applicable, no translator change.

🤖 Generated with Claude Code

- test_runner_calls_all_tests: follow a comprehension over globals() that
  hands each test to a call, so tests/test_feature_scan.py's run_tests([...])
  runner counts as dispatching every test. Its hand-kept RUNNER_SKIPS list
  goes away; test_out_named_like_the_optional_spirv_index() was missing from
  it and failed the check on main. Adds a bite check for the comprehension.
- runtime.yml: list tools/conformance/** in both path filters, as
  runtime/CMakeLists.txt builds from tools/conformance/native/src.
- compute_heap_layout_census.py: set errors="replace" on stdout at the top
  of its __main__ block like every other CLI tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@whoalin1

Copy link
Copy Markdown
Contributor

Independent verification — reproduced all three failures on current origin/main (3f81d46ac) then confirmed fixed on this head:

  1. test_runner_calls_all_tests.py FAILED on main (dead test_out_named_like_the_optional_spirv_index — globals()-comprehension dispatch not recognised) → 4/4 pass on PR.
  2. test_runtime_paths.py FAILED on main (tools/conformance/** missing from workflow path filters) → 5/5 pass on PR.
  3. test_tool_stdout_encoding.py FAILED on main (compute_heap_layout_census.py lacked the stdout guard) → 4/4 pass on PR; test_feature_scan.py also OK.

So main's consistency checks were genuinely red and this fixes all three. AI-assisted verification.

@GrahamboJangles

Copy link
Copy Markdown

Independently reproduced both sides on current main (Windows 11, python 3.14.9, python -I, CPU only).

Repro at current main 3f81d46ac (the claim cites 42537e7b; all three failures still measure red at the newer head, so the fix is still current):

  • tests/test_runner_calls_all_tests.py: 3 tests, 1 FAILURE — exactly tests/test_feature_scan.py: test_out_named_like_the_optional_spirv_index() reported dead.
  • tests/test_runtime_paths.py: 5 tests, 1 FAILURE — tools/conformance/**: missing (named in runtime/CMakeLists.txt).
  • tests/test_tool_stdout_encoding.py: 4 tests, 1 FAILURE — compute_heap_layout_census.py in the no-errors='replace' list.

At the PR diff (head 262c104e8, applied with git apply onto the fresh clone — applies with zero conflicts): all three files green. Test-count delta is real, not a swap: test_runner_calls_all_tests.py goes 3 tests FAILED -> 4 tests OK (the new test_a_globals_comprehension_dispatches_every_test executes and passes); the other two stay 5 OK and 4 OK as claimed.

Notes:

  • No checks have run on head 262c104e8 yet ("no checks reported"), so CI here is unmeasured rather than green; the local run above is the ground truth.
  • The dispatches_tests() comprehension rule matches only a bare loop-name elt; a runner wrapping the function in a call inside the comprehension still falls back to RUNNER_SKIPS. That direction is safe — the checker only ever errs toward more skips, never toward hiding a dead test.
  • No open duplicate: gh pr list --search test_runner_calls_all_tests and CI-MAIN-CONSISTENCY return no other open PRs.

Verdict: the fix does what it claims on current main; ready from my side.

@DeadlyChirp

Copy link
Copy Markdown

Tested on Windows 11, Python 3.12.10: merged 262c104 onto main at 71a769d.

  • python -I tests/test_runner_calls_all_tests.py: OK (fails on main)
  • python -I tests/test_runtime_paths.py: OK (fails on main)
  • python -I tests/test_tool_stdout_encoding.py: still FAILED, with 2 tools left:
    ['tools/game_run_summary.py', 'tools/stage_timeline.py']

Both tools landed after this PR was opened. #1837 (game_run_summary) and #1789 (stage_timeline) add the stdout guard to them. So the third check goes green only once those are merged, or this PR can cover them too.

(AI-assisted test run; output checked by hand.)

@OguzSoykan

Copy link
Copy Markdown

Verified on native Windows at head 262c104e8: test_runner_calls_all_tests.py, test_tool_stdout_encoding.py and test_runtime_paths.py all fail on main and pass here; test_feature_scan.py still passes. Note that #1561 (runner check + census stdout) and #1657 (runtime.yml path) overlap this one, so only one of them should land.

Native Windows 10 Pro 19045, CPython 3.12, py -3.12 -I, checkout under a non-ASCII profile path (C:\Users\Oğuz\..., TEMP is the 8.3 alias C:\Users\OUZ~1\...). No game files.

AI-assisted (Claude Code).

aslan2142 added a commit to ytsodacan/leonida that referenced this pull request Nov 26, 2026
…jectLeonida#1561 review)

- test_tool_stdout_encoding: three scripts merged since this PR opened
  (check_compute_journal_overlay.py and compute_workers_win.py with ProjectLeonida#2098,
  corpus_watch.py with ProjectLeonida#817) get the same stdout guard as the tools here.
- test_runtime_paths: the runtime workflow's two path filters now include
  tools/conformance/**, which runtime/CMakeLists.txt names. The change is
  ProjectLeonida#1673's (xel1uz), carried here since ProjectLeonida#1673 duplicates this PR.

With it, test_tool_stdout_encoding, test_runner_calls_all_tests and
test_runtime_paths all pass on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aslan2142

Copy link
Copy Markdown
Collaborator

Thanks for this! Closing as a duplicate of #1561, which is merged as f1afede5e.

  • Your fix landed there: the tools/conformance/** path filter in runtime.yml was what test_runtime_paths needed. It's in Fix two repository checks that fail on main #1561, credited to you.
  • The checker change (following the comprehension form instead of a RUNNER_SKIPS entry) isn't carried over. It's welcome as its own PR.

AI-assisted (Claude Code, Claude Opus 5.5).

@aslan2142 aslan2142 closed this Nov 26, 2026
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.

6 participants