CI: recognize mandatory PowerShell parameters in D3D12 launcher docs #2536

Closed
github-bot wants to merge 2 commits from github-bot/gh-2536 into main AGit
Owner

@⁠kirigayakazima on GitHub · 2026-11-28 01:17 UTC · original
kirigayakazima:codex/ci-d3d12-doc-cli-flags → main · +11 −3 · 1 files · 2 commits · closed without merging

CI-D3D12-DOC-CLI-FLAGS. Main already incorporates Rust/clap support and the replay guide correction via e890d0a10. On c8bf0e7b6 the remaining docs CLI check fails on the real -Game argument in the README: splitting a PowerShell declaration at its first equals sign truncates [Parameter(Mandatory = $true)] before the name.

Only a top-level assignment now starts the default value. The checker still tracks quotes, brackets and nested commas while skipping that value. A focused fixture asserts that both declared parameters are recognized and the variable in the default is excluded.

Windows verification: python -I tests/test_docs_cli_flags.py failed on main and passed all five tests on this head. Diff whitespace and no-game-data checks passed. GPUs tested: n/a. Independent change, AI-assisted with OpenAI Codex (GPT-6).

**@⁠kirigayakazima** on GitHub · 2026-11-28 01:17 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536) `kirigayakazima:codex/ci-d3d12-doc-cli-flags` → `main` · +11 −3 · 1 files · 2 commits · closed without merging CI-D3D12-DOC-CLI-FLAGS. Main already incorporates Rust/clap support and the replay guide correction via e890d0a10. On c8bf0e7b6 the remaining docs CLI check fails on the real -Game argument in the README: splitting a PowerShell declaration at its first equals sign truncates [Parameter(Mandatory = $true)] before the name. Only a top-level assignment now starts the default value. The checker still tracks quotes, brackets and nested commas while skipping that value. A focused fixture asserts that both declared parameters are recognized and the variable in the default is excluded. Windows verification: python -I tests/test_docs_cli_flags.py failed on main and passed all five tests on this head. Diff whitespace and no-game-data checks passed. GPUs tested: n/a. Independent change, AI-assisted with OpenAI Codex (GPT-6).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 01:21:52 +00:00
Author
Owner

@⁠timbot103 on GitHub · 2026-11-28 02:02 UTC · original

Reviewed at head f58e343f5 on Windows 11 (Python 3).

Verification

  • python -B -m unittest tests/test_docs_cli_flags.py -v: 5/5 tests OK (1.975 s).

Notes (non-blocking)

  • Recognizing clap option conventions including underscore-to-hyphen conversion and --skip-shader (tests/test_docs_cli_flags.py:22-30, 138-154, 260-279) and removing the stale --looks switch from d3d12/docs/replay.md:94-96 accurately match d3d12/apps/leonida/src/replay.rs:27-218.
  • Minor test note (tests/test_docs_cli_flags.py:269-286): Because flag validation unions tokens globally across all repo scripts, a removed Replay option whose name collides with another script (e.g., --only in tools/lds_fuzz.py:1121 / tools/ps_sweep.py:544) would still pass. Scoping d3d12/docs/replay.md specifically against Replay's clap definitions would catch that too.

Approve.

AI-assisted review + local Python verification.

**@⁠timbot103** on GitHub · 2026-11-28 02:02 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7232090278) Reviewed at head `f58e343f5` on Windows 11 (Python 3). ### Verification - `python -B -m unittest tests/test_docs_cli_flags.py -v`: **5/5 tests OK** (`1.975 s`). ### Notes (non-blocking) - Recognizing clap option conventions including underscore-to-hyphen conversion and `--skip-shader` (`tests/test_docs_cli_flags.py:22-30`, `138-154`, `260-279`) and removing the stale `--looks` switch from `d3d12/docs/replay.md:94-96` accurately match `d3d12/apps/leonida/src/replay.rs:27-218`. - **Minor test note (`tests/test_docs_cli_flags.py:269-286`):** Because flag validation unions tokens globally across all repo scripts, a removed `Replay` option whose name collides with another script (e.g., `--only` in `tools/lds_fuzz.py:1121` / `tools/ps_sweep.py:544`) would still pass. Scoping `d3d12/docs/replay.md` specifically against `Replay`'s clap definitions would catch that too. Approve. AI-assisted review + local Python verification.
Author
Owner

@⁠zmasi on GitHub · 2026-11-28 03:02 UTC · original

#2536 | head f58e343f57 (merged cleanly with main 02f71ccfe) | python -I tests/test_docs_cli_flags.py | red on main: FAILED (failures=1) in 4 tests (56 unknown documented flags; failures=1 in 5 tests on d3d12/docs/replay.md:96 --looks with PR test file copied onto main) | green on PR+main: Ran 5 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed (d3d12/docs/replay.md drops stale --looks, and tests/test_docs_cli_flags.py parses Rust #[arg(long...)] fields, excludes its own test file from source_flags, and scopes external flags per page in PAGE_FLAGS). Also verified on merged PR+main: python -I tests/test_docs_links.py (17/17 OK), python -I tests/test_text_write_line_endings.py (3/3 OK), git diff --check, and scripts/check_no_game_data.py (clean).

**@⁠zmasi** on GitHub · 2026-11-28 03:02 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7232756416) #2536 | head f58e343f574e8db19965970a7cc5f9aa4faceeef (merged cleanly with main 02f71ccfe) | `python -I tests/test_docs_cli_flags.py` | red on main: FAILED (failures=1) in 4 tests (56 unknown documented flags; failures=1 in 5 tests on `d3d12/docs/replay.md:96 --looks` with PR test file copied onto main) | green on PR+main: Ran 5 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed (`d3d12/docs/replay.md` drops stale `--looks`, and `tests/test_docs_cli_flags.py` parses Rust `#[arg(long...)]` fields, excludes its own test file from `source_flags`, and scopes external flags per page in `PAGE_FLAGS`). Also verified on merged `PR+main`: `python -I tests/test_docs_links.py` (17/17 OK), `python -I tests/test_text_write_line_endings.py` (3/3 OK), `git diff --check`, and `scripts/check_no_game_data.py` (clean).
Author
Owner

@⁠lixonik on GitHub · 2026-11-28 09:20 UTC · original · approved these changes

Reviewed the diff and tested merged onto main (493867366).

Extending tests/test_docs_cli_flags.py to index .rs clap #[arg(long ...)] declarations, scoping external tool options via PAGE_FLAGS, and removing the stale --looks reference in d3d12/docs/replay.md cleanly fixes the flag checker.

Tests run

  • python -I tests/test_docs_cli_flags.py: 5/5 passed (44.08 s).

AI-assisted (Antigravity, Gemini).

**@⁠lixonik** on GitHub · 2026-11-28 09:20 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#pullrequestreview-6096941318) · **approved these changes** Reviewed the diff and tested merged onto `main` (`493867366`). Extending `tests/test_docs_cli_flags.py` to index `.rs` clap `#[arg(long ...)]` declarations, scoping external tool options via `PAGE_FLAGS`, and removing the stale `--looks` reference in `d3d12/docs/replay.md` cleanly fixes the flag checker. ### Tests run - `python -I tests/test_docs_cli_flags.py`: **5/5 passed** (44.08 s). AI-assisted (Antigravity, Gemini).
Author
Owner

@⁠Mby159 on GitHub · 2026-11-28 13:20 UTC · original

Independent confirmation of the --looks finding, from a separate analysis of the same failure:

--looks is not an option that was renamed. A code search for "--looks" in this repository returns d3d12/docs/replay.md and nothing else, and the whole d3d12/ tree landed in a single commit, so the option never existed in any revision here. The look at what the dispatches have bound is --flow (play::look::flow; the table below that line already lists --flow <lists>), so dropping the name, as this pull request does, is the honest correction.

I reached the same 56 entries and the same cause by a different route: mapping each of the 44 Rust flags to its clap field name, and all 44 have an identifier in the Rust sources. I am not opening a pull request for it - this one covers it, and better (the external flags scoped per page, and the checker out of its own evidence).

**@⁠Mby159** on GitHub · 2026-11-28 13:20 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7239868303) Independent confirmation of the `--looks` finding, from a separate analysis of the same failure: `--looks` is not an option that was renamed. A code search for `"--looks"` in this repository returns `d3d12/docs/replay.md` and nothing else, and the whole `d3d12/` tree landed in a single commit, so the option never existed in any revision here. The look at what the dispatches have bound is `--flow` (`play::look::flow`; the table below that line already lists `--flow <lists>`), so dropping the name, as this pull request does, is the honest correction. I reached the same 56 entries and the same cause by a different route: mapping each of the 44 Rust flags to its clap field name, and all 44 have an identifier in the Rust sources. I am not opening a pull request for it - this one covers it, and better (the external flags scoped per page, and the checker out of its own evidence).
Author
Owner

@⁠aegish-zagi on GitHub · 2026-11-28 22:52 UTC · original · reviewed

Independent review (Linux, Python 3.12.3, AI-assisted) against current main adfb3821a:

  • Blocker: this PR now conflicts with current main in both files it touches — git merge-tree --write-tree main HEAD reports content conflicts in d3d12/docs/replay.md and tests/test_docs_cli_flags.py, and GitHub shows it CONFLICTING. It needs a rebase before it can land (expect the needs rebase label).
  • On its own head (f58e343f5) the change itself is sound: python -I tests/test_docs_cli_flags.py runs 5 tests OK, versus 4 OK on bare main — the added coverage is the replay-docs-vs-clap check, and the one-line replay.md fix matches it.
  • I did not re-run the check against a merged state, because there is no clean merged state to run until the rebase lands; the earlier verification on this PR was against an older main.

Ask: rebase on current main and re-run tests/test_docs_cli_flags.py on the result; nothing else in the change looks wrong from this side.

**@⁠aegish-zagi** on GitHub · 2026-11-28 22:52 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#pullrequestreview-6100428920) · **reviewed** Independent review (Linux, Python 3.12.3, AI-assisted) against current main adfb3821a: - Blocker: this PR now conflicts with current main in both files it touches — `git merge-tree --write-tree main HEAD` reports content conflicts in `d3d12/docs/replay.md` and `tests/test_docs_cli_flags.py`, and GitHub shows it CONFLICTING. It needs a rebase before it can land (expect the `needs rebase` label). - On its own head (f58e343f5) the change itself is sound: `python -I tests/test_docs_cli_flags.py` runs 5 tests OK, versus 4 OK on bare main — the added coverage is the replay-docs-vs-clap check, and the one-line `replay.md` fix matches it. - I did not re-run the check against a merged state, because there is no clean merged state to run until the rebase lands; the earlier verification on this PR was against an older main. Ask: rebase on current main and re-run `tests/test_docs_cli_flags.py` on the result; nothing else in the change looks wrong from this side.
github-bot changed title from CI: validate D3D12 replay documentation against Rust clap options to CI: recognize mandatory PowerShell parameters in D3D12 launcher docs 2026-11-29 03:07:38 +00:00
Author
Owner

@⁠OreoFR on GitHub · 2026-11-29 03:13 UTC · original

Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head 0f91e0bca : red 2 failures / green 5 OK

python3.12 -I tests/test_docs_cli_flags.py (5 tests):

  • Merge: clean. The parser under test (extract_ps1_params) lives in the test file, so red = main's test file + only the new test method.
  • Red: 2 failures: test_parameter_attribute_assignment_and_default (new) and test_fenced_commands_use_the_flags_of_their_tool (already failing on main: README.md:94 passes -Game to scripts/play-d3d12.ps1).
  • Green (main + git merge --no-ff): 5/5 OK, skipped 0. This PR fixes the main failure: $Game is declared with [Parameter(Mandatory = $true)], and the old split on = cut the declaration inside the attribute, before $Game (READ IN CODE).
  • (MEASURED n=3) the new test fails 3/3 on red.
  • Neighbours (the 12 other tests/test_docs_*): all OK on main and merge, except test_docs_links::test_every_relative_link_resolves, failing identically on both (3/3), unrelated.
  • Diff: the parser now skips everything after a = outside brackets/parentheses up to the next comma, covering defaults and attribute assignments. Correct and minimal. No game data.

Verdict: READY

AI-assisted: Claude Code

**@⁠OreoFR** on GitHub · 2026-11-29 03:13 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7249921487) Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head 0f91e0bca : red 2 failures / green 5 OK `python3.12 -I tests/test_docs_cli_flags.py` (5 tests): - Merge: clean. The parser under test (`extract_ps1_params`) lives in the test file, so red = main's test file + only the new test method. - **Red**: 2 failures: `test_parameter_attribute_assignment_and_default` (new) and `test_fenced_commands_use_the_flags_of_their_tool` (already failing on main: `README.md:94` passes `-Game` to `scripts/play-d3d12.ps1`). - **Green** (main + `git merge --no-ff`): 5/5 OK, skipped 0. **This PR fixes the main failure**: `$Game` is declared with `[Parameter(Mandatory = $true)]`, and the old split on `=` cut the declaration inside the attribute, before `$Game` (READ IN CODE). - (MEASURED n=3) the new test fails 3/3 on red. - Neighbours (the 12 other `tests/test_docs_*`): all OK on main and merge, except `test_docs_links::test_every_relative_link_resolves`, failing identically on both (3/3), unrelated. - Diff: the parser now skips everything after a `=` outside brackets/parentheses up to the next comma, covering defaults and attribute assignments. Correct and minimal. No game data. **Verdict: READY** AI-assisted: Claude Code
Author
Owner

@⁠timbot103 on GitHub · 2026-11-29 04:29 UTC · original · reviewed

Reviewed head 0f91e0bca against b6bf3aa0b. The top-level assignment check in tests/test_docs_cli_flags.py:126 keeps [Parameter(Mandatory = $true)] intact in scripts/play-d3d12.ps1:40, so the checker accepts -Game in the fenced command at README.md:94. The fixture at tests/test_docs_cli_flags.py:231 checks that both declared parameters are extracted and $defaultCount is excluded.

I traced the scanner through the declaration split over two lines at scripts/windows-boot/boot.ps1:135 and the stacked validation and type attributes, switches, and defaults in both launcher parameter blocks. The wrapper passes Exe in its splatted arguments to d3d12/scripts/play-nvidia.ps1, where [Parameter(Mandatory)] declares it. The fenced-command check indexes root-level scripts/ and tools/ paths, so I inspected the NVIDIA launcher declaration directly.

No findings. Static audit only. No builds, tests, or GPU runs.

AI-assisted.

**@⁠timbot103** on GitHub · 2026-11-29 04:29 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#pullrequestreview-6101401843) · **reviewed** Reviewed head `0f91e0bca` against `b6bf3aa0b`. The top-level assignment check in `tests/test_docs_cli_flags.py:126` keeps `[Parameter(Mandatory = $true)]` intact in `scripts/play-d3d12.ps1:40`, so the checker accepts `-Game` in the fenced command at `README.md:94`. The fixture at `tests/test_docs_cli_flags.py:231` checks that both declared parameters are extracted and `$defaultCount` is excluded. I traced the scanner through the declaration split over two lines at `scripts/windows-boot/boot.ps1:135` and the stacked validation and type attributes, switches, and defaults in both launcher parameter blocks. The wrapper passes `Exe` in its splatted arguments to `d3d12/scripts/play-nvidia.ps1`, where `[Parameter(Mandatory)]` declares it. The fenced-command check indexes root-level `scripts/` and `tools/` paths, so I inspected the NVIDIA launcher declaration directly. No findings. Static audit only. No builds, tests, or GPU runs. AI-assisted.
Author
Owner

@⁠OreoFR on GitHub · 2026-11-29 08:34 UTC · original

Thanks for this PR. It has a red/green verification by OreoFR on macOS (READY): #2536

The only thing missing for a merge is your claim in the coordination issue #2570 (see CONTRIBUTING.md). Once it is there, a maintainer can pick it up.

AI-assisted: Claude Code

**@⁠OreoFR** on GitHub · 2026-11-29 08:34 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7253192336) Thanks for this PR. It has a red/green verification by OreoFR on macOS (READY): https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2536 The only thing missing for a merge is your claim in the coordination issue #2570 (see CONTRIBUTING.md). Once it is there, a maintainer can pick it up. AI-assisted: Claude Code
Author
Owner

@⁠KelboLive on GitHub · 2026-11-30 16:38 UTC · original

Independent check on Windows (not the author), at 0f91e0bca.

  • python -I tests/test_docs_cli_flags.py: 5 tests OK in 14.6 s.

Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10.

AI-assisted: yes (opencode).

**@⁠KelboLive** on GitHub · 2026-11-30 16:38 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7284992036) Independent check on Windows (not the author), at `0f91e0bca`. - `python -I tests/test_docs_cli_flags.py`: **5 tests OK** in 14.6 s. Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10. AI-assisted: yes (opencode).
github-bot closed this pull request 2026-12-01 11:14:01 +00:00
Author
Owner

@⁠kirigayakazima on GitHub · 2026-12-01 11:12 UTC · original

Thank you @⁠OreoFR, @⁠timbot103, @⁠lixonik, @⁠zmasi, @⁠imShangLi, @⁠aegish-zagi, and @⁠KelboLive for reviewing and testing this PR! main has already landed the extract_ps1_params fix for [Parameter(Mandatory = $true)] and top-level = handling in tests/test_docs_cli_flags.py, so closing this PR cleanly as superseded by main. (AI-assisted.)

**@⁠kirigayakazima** on GitHub · 2026-12-01 11:12 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7309326542) Thank you @⁠OreoFR, @⁠timbot103, @⁠lixonik, @⁠zmasi, @⁠imShangLi, @⁠aegish-zagi, and @⁠KelboLive for reviewing and testing this PR! `main` has already landed the `extract_ps1_params` fix for `[Parameter(Mandatory = $true)]` and top-level `=` handling in `tests/test_docs_cli_flags.py`, so closing this PR cleanly as superseded by `main`. (AI-assisted.)

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2536
No description provided.