D3D12-DOCS-SWITCHES-TEST: fail standalone tests when d3d12/docs/switches.md drifts #2934
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2934"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-12-01T19:56:31Z.
Claimed in the coordination issue as: D3D12-DOCS-SWITCHES-TEST (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7323577585; ref finding https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7302596030)
What and why
tests/test_d3d12_switches.pypreviously generatedpage.mdinto a temporary directory and ran--checkagainst that just-generated copy, so drift between the D3D12 runtime sources and the trackedd3d12/docs/switches.mdwent unnoticed in CI.Added
CommandTest.test_the_tracked_switches_page_matches_the_sources, which runsd3d12_switches.main(["--root", ROOT, "--check", "d3d12/docs/switches.md"])and prints the exact missing/removed names and regeneration command on failure. Becausetests/test_d3d12_switches.pyis already executed byscripts/run_standalone_tests.pyin both Windows and Linux CI jobs, no workflow YAML changes are needed.Tested
LEONIDA_PIPELINE_SLOWfromd3d12/docs/switches.mdcausedtest_the_tracked_switches_page_matches_the_sourcesto fail withmissing from the page: LEONIDA_PIPELINE_SLOW(exit 1); restoring it passed (exit 0).python -I tests/test_d3d12_switches.py -v: 20 passed, 0 failed.python -I tests/test_ci_registration.py -v: 18 passed, 0 failed.python -I scripts/check_no_game_data.py tests/test_d3d12_switches.py: clean.GPUs tested: n/a (stdlib Python doc-hygiene test; Windows 11).
AI-assisted: yes — Gemini 4 Neon (implementation and an independent read-only reviewer pass).
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T20:26:32Z.
Switch inventory red and green on the combined tree for
2190bf98merged into19d5f83c. The clean test file was 19/19 onmainand 20/20 with the PR. I removed the existingLEONIDA_PANELrow on each tree. The standalone--checkfailed on both, while the normal test file stayed green onmainand failed in the new test on the PR, reporting that exact name. Changing only that row’s description kept the new test green, so this covers the switch-name inventory.The real combined tree with #2929 (
51818b7e) failed in the new test and in--checkon exactlyLEONIDA_PIPELINE_STACK_MIBandLEONIDA_VRAM_GUARD_PCT. Runningpython -I tools/d3d12_switches.py --out d3d12/docs/switches.mdmade--checkand all 20 tests pass again.MEASURED with OpenAI Codex and a separate read-only review.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-01T21:16:05Z.
RUN (independent check on Windows, #2934 head
2190bf988, merged locally intomain1fff69129withgit merge --no-ff, no conflicts.)Python 3.13.12:
main1fff69129itself:python -I tools/d3d12_switches.py --check d3d12/docs/switches.mdexits 0, so the tracked page is in sync today and the new test passes on the merge from the start.python -I tests/test_d3d12_switches.py: 20 tests, OK.python -I tests/test_ci_registration.py: 18 tests, OK.LEONIDA_PIPELINE_SLOWrow removed fromd3d12/docs/switches.md,test_the_tracked_switches_page_matches_the_sourcesfails ("missing from the page: LEONIDA_PIPELINE_SLOW"), the other 19 pass; with the row put back, 20 OK.d3d12_switches.mainwith--rooton the repository and--checkon the tracked page, and prints the regeneration command on failure. Note for maintainers: once merged, any change that adds or renames aLEONIDA_switch without regenerating the page fails the standalone tests, on pull requests and on direct pushes alike (the page has drifted onmainseveral times this week).Machine: Windows 11 Pro 26300, Python 3.13.12.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T21:35:01Z.
Merging. Head
2190bf988merges cleanly withmain1fff69129and does not force a rebase of #2566. Ran main plus the PR myself: test_d3d12_switches 20 green, ci_registration 18, line endings 3, stdout encoding 4 green; test-only change. Third-party red/green by enlight3d on this head; internal code review ACCEPTE. Merged by MoonEyes.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T21:37:42Z.
Review: COMMENTED
The name-inventory guard works: removing
LEONIDA_PIPELINE_SLOW, adding a source switch, or appending a ghost row each fail with the exact name and the regeneration command, and the file is picked up byrun_standalone_tests.pyon both OS jobs.But the test name overclaims:
--checkcompares only the row name set (tools/d3d12_switches.py:270-277). On this head the page already differs from--out—LEONIDA_RENDER_SCALE_MINstill saysleonida-loader/hooks.rs +1(switches.md:681) while--outemitsleonida-gpu/menu.rs +2because ofd3d12/crates/leonida-gpu/src/host/menu.rs:65— and both--checkand the new test pass. Editing the count line (switches.md:8), flipping an A/B cell, or rewording the header also passes.Either rename to
..._switch_names_match_the_sources(and say "names only" in the docstring), or compare full text (ds.page(ds.gather(ROOT)) == open(switches).read()) so columns, count and descriptions are covered. The full-text version would also have caught that stale row, which is exactly the kind of drift this test is for — though it means any comment that merely mentions a switch elsewhere dirties the page.Also
tools/d3d12_switches.py:235andswitches.md:4still say "No CI job keeps it up to date", which this PR makes false; update that sentence (and regenerate) if you keep the current name-set scope.Suite is 20/20, standalone selection works, merge is clean. No clean-room or runner concerns.