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

Closed
kirigayakazima wants to merge 2 commits from upstream-pr/2536 into main
kirigayakazima commented 2026-11-28 01:17:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-28T01:17:44Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5535290165 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-28T01:17:44Z. --- 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).
timbot103 commented 2026-11-28 02:02:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:39Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232090278 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7232090278). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-28T02:02:39Z. --- 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.
zmasi commented 2026-11-28 03:02:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T03:02:37Z.


#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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232756416 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7232756416). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T03:02:37Z. --- #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).
lixonik commented 2026-11-28 09:20:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T09:20:44Z.

Review: APPROVED


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6096941318 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#pullrequestreview-6096941318). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-28T09:20:44Z. **Review:** APPROVED --- 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).
Mby159 commented 2026-11-28 13:20:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mby159 on 2026-11-28T13:20:38Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7239868303 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7239868303). Originally posted by [Mby159](https://github.com/Mby159) on 2026-11-28T13:20:38Z. --- 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).
aegish-zagi commented 2026-11-28 22:52:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-11-28T22:52:01Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6100428920 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#pullrequestreview-6100428920). Originally posted by [aegish-zagi](https://github.com/aegish-zagi) on 2026-11-28T22:52:01Z. **Review:** COMMENTED --- 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.
OreoFR commented 2026-11-29 03:13:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T03:13:55Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249921487 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7249921487). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T03:13:55Z. --- 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
timbot103 commented 2026-11-29 04:29:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:29:23Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6101401843 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#pullrequestreview-6101401843). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-29T04:29:23Z. **Review:** COMMENTED --- 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.
OreoFR commented 2026-11-29 08:34:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T08:34:27Z.


Thanks for this PR. It has a red/green verification by OreoFR on macOS (READY): https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7249921487

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7253192336 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7253192336). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T08:34:27Z. --- Thanks for this PR. It has a red/green verification by OreoFR on macOS (READY): https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7249921487 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
KelboLive commented 2026-11-30 16:38:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:38:19Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7284992036 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7284992036). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T16:38:19Z. --- 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).
kirigayakazima commented 2026-12-01 11:12:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-12-01T11:12:48Z.


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.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7309326542 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2536#issuecomment-7309326542). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-12-01T11:12:48Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
ProjectLeonida/mandy!2536
No description provided.