Skip to content

docs: close the d3d12_placed_dimensions fence; the flag check follows dev.py's forwarded subcommands - #7242

Open
Unix-Epoch wants to merge 1 commit into
ItsNotRexed:mainfrom
Unix-Epoch:docs-dev-tools-fences
Open

Unix-Epoch wants to merge 1 commit into
ItsNotRexed:mainfrom
Unix-Epoch:docs-dev-tools-fences

Conversation

@Unix-Epoch

Copy link
Copy Markdown

Claimed in the coordination issue as: finding + claiming

What and why

Two docs tests are red on main (8575d36) since #6691 added docs/dev-tools.md:

  • tests/test_docs_links.py: docs/dev-tools.md links ../runtime/README.md#a-600-frame-headless-guest-scene. The heading exists, but runtime/README.md leaves the d3d12_placed_dimensions_test block (line 453) without its closing fence, so every heading after it is inside a code block: GitHub renders the rest of the page as code, and the checker finds none of those anchors. This adds the missing fence.
  • tests/test_docs_cli_flags.py: dev.py boot-trace and dev.py guest-scene hand their arguments unparsed to tools/boot_trace.py and scripts/run_guest_scene.py (run_producer), so the fenced commands at docs/dev-tools.md:43 and :69 use those tools' flags (--d3d12, --guest, --loader, --negative-controls, --shaders). The checker now has a FORWARDED table for those two subcommands and accepts the forwarded tool's flags on them only. A unit case pins that the same flag on dev.py discover is still reported, and test_forwarded_subcommands_name_their_target fails if dev.py stops forwarding to the listed path.

No change to dev.py or to any tool.

Tested

macOS (Apple Silicon), CPython 3.14.7, CPU only, no game files.

  • python -I tests/test_docs_links.py: 7 OK; python -I tests/test_docs_cli_flags.py: 4 OK.
  • Negative control: with the change stashed, both files fail (1 failure each, the two above).
  • python -m pytest tests/test_docs_*.py: 37 passed.
  • python -m compileall -q tests/test_docs_cli_flags.py, git diff --check: clean.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a, no translator change)

🤖 Generated with Claude Code

… dev.py's forwarded subcommands

runtime/README.md left the d3d12_placed_dimensions_test block unclosed, so every heading after it
rendered as code and test_docs_links found no anchor for docs/dev-tools.md's guest-scene link.
test_docs_cli_flags read the boot-trace and guest-scene flags in docs/dev-tools.md as scripts/dev.py's
own; it now also accepts the forwarded tool's flags on those two subcommands.

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

Copy link
Copy Markdown

Independent native Windows/Python 3.15 verification at 03bf075: python -I tests/test_docs_cli_flags.py passes 4/4; python -I tests/test_docs_links.py passes 7/7 in an isolated worktree. Main 8575d36 audit fails both. The synthetic forwarding check accepts --d3d12 for boot-trace while rejecting it for discover, and target mapping checks pass. Existing #7217 overlaps the README fence hunk. CPU-only, no GPU/game files. AI-assisted (Codex).

@LAKSHYA-cmd-tech LAKSHYA-cmd-tech 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.

Independent Windows CPU verification at 03bf0754834d68ff122260d15f164f6579001fd5.

Environment & Test Suite

  • Platform: Native Windows 11 x64, Python 3.12 / 3.13, CPU-only.
  • Clean-room: Pure documentation and test fixtures, zero game data (scripts/check_no_game_data.py passes with exit 0).

Verification

  • python -I tests/test_docs_links.py ran 7 tests, OK (0.30s) — verified runtime/README.md closing code fence at line 455 resolves anchor for #a-600-frame-headless-guest-scene in docs/dev-tools.md.
  • python -I tests/test_docs_cli_flags.py ran 4 tests, OK (12.10s) — verified FORWARDED table for scripts/dev.py subcommands (boot-trace -> tools/boot_trace.py, guest-scene -> scripts/run_guest_scene.py), negative control on unforwarded subcommands, and target existence assertions.
  • python -I -m compileall tests/test_docs_cli_flags.py: clean, exit 0.
  • git diff --check: clean (0).

LGTM. Approved.

@morodirule

Copy link
Copy Markdown

Tested 03bf075 on Arch Linux, Python 3.14.10, CPU only: pass — test_docs_links 7/7 and test_docs_cli_flags 4/4 OK. Overlap note: this covers the same unclosed fence as #7228 (fence-only) plus the dev.py flag-check follow-up, so per the board rule one of the two should land and the other rebase/close — this one is the superset. No game files, no GPU. AI-assisted.

@best2135

Copy link
Copy Markdown

Tested 03bf075 on Linux (kernel 7.2), Python 3.14.8, CPU only: pass

On main (26ecd9f) test_docs_cli_flags, test_docs_links fail; at this head and with this head merged onto 26ecd9f they pass.

python -I tests/test_docs_cli_flags.py
python -I tests/test_docs_links.py

AI-assisted check (Claude Code); counts and pass/fail only, no game data.

@Poussistar

Copy link
Copy Markdown

Tested 03bf075 on Linux (4 cores, Python 3.14.7): this pull request turns two red tests green, and it is the only one of the open candidates that does both.

clean worktree at origin/main (d90444f)      with #7242 applied
tests/test_docs_cli_flags.py   ROUGE         vert
tests/test_docs_links.py       ROUGE         vert

For comparison, on the same tree: #7228 and #7217 each make test_docs_links green but leave test_docs_cli_flags red, and #6590 makes test_docs_cli_flags green but leaves test_docs_links red. This one covers both (docs/dev-tools.md line 43's flag and the ../runtime/README.md#a-600-frame-headless-guest-scene anchor).

No game files, no GPU, no Windows.

@neoisg8

neoisg8 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested on Windows 11 x64, Python 3.14.0rc2, CPU-only; pure docs/tests, zero game data.

Verification & Negative Controls

  1. Unclosed code fence in runtime/README.md:

    • On origin/main (a12cb8598), python -I tests/test_docs_links.py failed with:
      FAIL: test_every_relative_link_resolves
      AssertionError: Lists differ: [('docs\\dev-tools.md', '../runtime/README.md#a-600-frame-headless-guest-scene', 'anchor not found')] != []
      
      Caused by the unclosed fence at line 453 (d3d12_placed_dimensions_test) which swallowed all subsequent headings into a code block.
    • With PR docs: close the d3d12_placed_dimensions fence; the flag check follows dev.py's forwarded subcommands #7242 closing fence at line 455, test_docs_links.py passes cleanly: 7/7 OK (0.36s).
  2. dev.py forwarded subcommands in test_docs_cli_flags.py:

Findings

  1. Test method nesting / split in tests/test_docs_cli_flags.py:
    In tests/test_docs_cli_flags.py, def test_forwarded_subcommands_name_their_target(self) was inserted directly before ps1_pages = ...:

            # a forwarding subcommand may use the forwarded tool's flags, and only on that subcommand
            dev_pages = {"docs/c.md": "```\npython -I scripts/dev.py boot-trace t.jsonl --d3d12 e.log\n"
                                      "python -I scripts/dev.py discover --d3d12\n```\n"}
            dev_sources = {"scripts/dev.py": 'add("--json")', "tools/boot_trace.py": 'add("--d3d12")'}
            self.assertEqual(tool_flag_mismatches(dev_pages, dev_sources), [("docs/c.md:3", "scripts/dev.py", "--d3d12")])
    
        def test_forwarded_subcommands_name_their_target(self):
            # FORWARDED must follow the script: each target path is the one the script forwards to, and it exists.
            files = set(tracked_files())
            for (script, sub), target in FORWARDED.items():
                text = read(script)
                self.assertIn(f'"{sub}"', text, f"{script} has no {sub} subcommand")
                self.assertIn(f'"{target}"', text, f"{script} does not forward to {target}")
                self.assertIn(target, files)
    
            ps1_pages = {"docs/b.md": "```\n.\\scripts\\test.ps1 -ValidParam -BadParam\n```\n"}
            ps1_sources = {"scripts/test.ps1": "param([string]$ValidParam)"}
            self.assertEqual(ps1_flag_mismatches(ps1_pages, ps1_sources), [("docs/b.md:2", "scripts/test.ps1", "-BadParam")])

    This accidentally stranded the ps1_pages / ps1_flag_mismatches check inside test_forwarded_subcommands_name_their_target instead of leaving it in test_checkers_report_only_the_missing_flag. Moving ps1_pages ... above def test_forwarded_subcommands_name_their_target keeps test_checkers_report_only_the_missing_flag testing both Python and PowerShell flag mismatches.

  2. Interaction with latest main (a12cb8598):
    When merging with latest origin/main, test_docs_name_existing_flags fails on the 7 external spirv-opt pass flags (--ssa-rewrite, --eliminate-dead-code-aggressive, etc.) recently documented in docs/embedded_shaders.md:372-377 by docs: the AMD driver took 34 minutes on LeafRehydration's dispatch-loop module; the current translation compiles in 3 s (SHADER-995) #6739. That is handled by test_docs_cli_flags: allow spirv-opt pass flags cited in docs/embedded_shaders.md #7476 in FOREIGN, so rebasing on or landing alongside test_docs_cli_flags: allow spirv-opt pass flags cited in docs/embedded_shaders.md #7476 will make the full file green.

AI-assisted.

@aarushkha

Copy link
Copy Markdown

Tested 03bf075 merged onto main 86a7807dd on Windows 10 Pro 22H2 (19045), Python 3.14.3: pass.

  • python -I tests/test_docs_cli_flags.py: Ran 4 tests in 23.287s OK (red on main)

Its README fence is the same two lines as #7217 and #7228; with this one test_docs_links passes too.

It merges cleanly together with #7092 #6049 #7120 #6513 #7209 #6254 #7214 #6957 #7309 #4771 #7029 #7094 #7129 #6508 #7152 #7174 #7032 onto main; with all of them applied, the only standalone test still red on Windows is test_first_look_paths (claimed by Racurs156). Summary in #7333.

No GPU or game files needed. AI-assisted (Claude Code); I read the diff before running it.

@Daazd

Daazd commented Nov 23, 2026

Copy link
Copy Markdown

Independent check (Linux, Python 3.12.3, Node 24.13, CPU only, no game files): head 03bf07548 merged onto main 6a4299563: merges clean.

  • python3 -I tests/test_docs_cli_flags.py: Ran 4 tests in 8.302s FAILED (failures=1) (exit 1)

Clears the docs/dev-tools.md entries in test_docs_cli_flags (overlaps #6590, which does the same). The remaining docs/embedded_shaders.md spirv-opt flags are #7476's.

AI-assisted (Claude Code).

@airp1ane

Copy link
Copy Markdown
Contributor

Tested 03bf075 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass.

Ran the test files this PR adds or changes, from a clean checkout of the PR head: test_docs_cli_flags.py - all exit 0.

AI-assisted (Claude Code).

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.

10 participants