Validate the D3D12 switch catalog header count #3270

Closed
merzleckeier wants to merge 2 commits from upstream-pr/3270 into main
merzleckeier commented 2026-12-03 00:45:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T00:45:17Z.


Claimed in the coordination issue as D3D12-SWITCH-CATALOG-HEADER.

What and why

After #3154, the catalog had 683 runtime rows and still said 682 in the header. The existing name-set check accepted that page. Make tools/d3d12_switches.py --check require the runtime count in the catalog preamble and compare it with the runtime table rows.

Merged current main (516c9eaa) after #3276 regenerated the catalog. Its header and runtime table now both count 684 names, and a fresh generation is byte-for-byte identical. The current PR adds the check and its regression test.

Tested

  • On current main, the CLI regression fails in all three malformed cases: stale, missing, or moved header. All cases pass with the check in place.
  • The tracked catalog passes --check. All 21 switch tests and 59 documentation tests passed. The desktop launcher suite had 86 passes and one skip.
  • Independent read-only review, the full tracked-file clean-room scan, and git diff --check passed.

GPUs tested: n/a.

AI-assisted: OpenAI Codex (GPT-6 family), with independent read-only review by GPT-6.2 Sol.

Checklist

  • Includes current main and merges cleanly.
  • One topic.
  • Clean-room scan passed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5617458192 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3270). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T00:45:17Z. --- Claimed in the coordination issue as [D3D12-SWITCH-CATALOG-HEADER](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7363454765). ### What and why After #3154, the catalog had 683 runtime rows and still said 682 in the header. The existing name-set check accepted that page. Make `tools/d3d12_switches.py --check` require the runtime count in the catalog preamble and compare it with the runtime table rows. Merged current `main` (`516c9eaa`) after #3276 regenerated the catalog. Its header and runtime table now both count 684 names, and a fresh generation is byte-for-byte identical. The current PR adds the check and its regression test. ### Tested - On current `main`, the CLI regression fails in all three malformed cases: stale, missing, or moved header. All cases pass with the check in place. - The tracked catalog passes `--check`. All 21 switch tests and 59 documentation tests passed. The desktop launcher suite had 86 passes and one skip. - Independent read-only review, the full tracked-file clean-room scan, and `git diff --check` passed. GPUs tested: n/a. AI-assisted: OpenAI Codex (GPT-6 family), with independent read-only review by GPT-6.2 Sol. ### Checklist - [x] Includes current `main` and merges cleanly. - [x] One topic. - [x] Clean-room scan passed.
fiestorra commented 2026-12-03 02:51:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T02:51:12Z.


VERIFY-3270 — Windows nativo: el --check ahora también valida el recuento, y mentir en él falla

Un commit, tres ficheros, merge limpio:

tools/d3d12_switches.py      | 19 ++++++++++++++----
tests/test_d3d12_switches.py | 27 +++++++++++++++++
d3d12/docs/switches.md       |  2 +-

En el head (464f84520):

pytest tests/test_d3d12_switches.py -q          21 passed, 4 subtests passed   (7.9 s)
python -I tools/d3d12_switches.py --out …       727 names written
sha256 before == after                          True
python -I tools/d3d12_switches.py --check …     exit 0

Control (sintético): bajé el recuento declarado del documento en uno — 683 names → 682 names, sin tocar ninguna fila — y el check falla:

1 failed, 20 passed, 4 subtests passed
AssertionError: 1 != 0 : d3d12/docs/switches.md is out of date (regenerate with `p…

Muerde, y es el caso que el cambio añade: hasta ahora --check comparaba los nombres de las filas y nada más, así que un documento con el recuento escrito a mano podía decir 683 con 727 filas y pasar. El preamble y el re.search(r"^([0-9]+) names;", …) son lo que cierra eso.

Y la otra mitad, que es la que evita el fallo contrario: regenerar deja el fichero byte-idéntico — así que el recuento del documento no es una cifra independiente, sale de la misma lista que las filas, y por eso el check puede exigir las dos cosas sin que una pueda ir con la otra.

Lo que no probé: el caso de una fila añadida a mano sin pasar por el generador — --check la detecta por el conjunto de nombres (gone/missing), que ya estaba antes de este cambio; lo nuevo es sólo el recuento del encabezado.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7365930596 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3270#issuecomment-7365930596). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T02:51:12Z. --- ## VERIFY-3270 — Windows nativo: el `--check` ahora también valida el recuento, y mentir en él falla **Un commit, tres ficheros, merge limpio**: ``` tools/d3d12_switches.py | 19 ++++++++++++++---- tests/test_d3d12_switches.py | 27 +++++++++++++++++ d3d12/docs/switches.md | 2 +- ``` **En el head (`464f84520`)**: ``` pytest tests/test_d3d12_switches.py -q 21 passed, 4 subtests passed (7.9 s) python -I tools/d3d12_switches.py --out … 727 names written sha256 before == after True python -I tools/d3d12_switches.py --check … exit 0 ``` **Control (sintético)**: **bajé el recuento declarado del documento en uno** — **`683 names` → `682 names`**, **sin tocar ninguna fila** — **y el check falla**: ``` 1 failed, 20 passed, 4 subtests passed AssertionError: 1 != 0 : d3d12/docs/switches.md is out of date (regenerate with `p… ``` **Muerde, y es el caso que el cambio añade**: **hasta ahora `--check` comparaba los *nombres* de las filas y nada más**, **así que un documento con el recuento escrito a mano podía decir 683 con 727 filas y pasar**. **El `preamble` y el `re.search(r"^([0-9]+) names;", …)` son lo que cierra eso.** **Y la otra mitad, que es la que evita el fallo contrario**: **regenerar deja el fichero byte-idéntico** — **así que el recuento del documento no es una cifra independiente**, **sale de la misma lista que las filas**, **y por eso el check puede exigir las dos cosas sin que una pueda ir con la otra.** **Lo que no probé**: **el caso de una fila añadida a mano sin pasar por el generador** — **`--check` la detecta por el conjunto de nombres (`gone`/`missing`), que ya estaba antes de este cambio**; **lo nuevo es sólo el recuento del encabezado.**
aegish-zagi commented 2026-12-03 04:59:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-12-03T04:59:15Z.


VERIFY-3270 — PASS

PR #3270 | head 2649375a81 | merged cleanly with current main (d9b618f10) in a scratch worktree, no conflicts
Tests run: tests/test_d3d12_switches.py (python -I, stdlib unittest), 21 tests
Red on main: FAILED (failures=3) with the PR's tests on main code — MEASURED
Green on PR: OK, all 21 tests — MEASURED
Diff audit: tools/d3d12_switches.py + tests/test_d3d12_switches.py only; the switch catalog header count is now validated against the catalog, no game data — READ IN CODE
Platform: Linux, Python 3.12.3, no GPU

AI-assisted: yes (Muse Wonder, Muse by Meta)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368252645 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3270#issuecomment-7368252645). Originally posted by [aegish-zagi](https://github.com/aegish-zagi) on 2026-12-03T04:59:15Z. --- VERIFY-3270 — PASS PR #3270 | head 2649375a81887552a66150be583dd7d4a5bd6328 | merged cleanly with current main (d9b618f10) in a scratch worktree, no conflicts Tests run: tests/test_d3d12_switches.py (python -I, stdlib unittest), 21 tests Red on main: FAILED (failures=3) with the PR's tests on main code — MEASURED Green on PR: OK, all 21 tests — MEASURED Diff audit: tools/d3d12_switches.py + tests/test_d3d12_switches.py only; the switch catalog header count is now validated against the catalog, no game data — READ IN CODE Platform: Linux, Python 3.12.3, no GPU AI-assisted: yes (Muse Wonder, Muse by Meta)
lixonik commented 2026-12-03 06:30:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:30:24Z.


Windows native verification (red -> green) -- PASS on head 2649375a8 (merged cleanly via git merge --no-ff onto main d9b618f10).

Checks (Windows 10 x64, Python 3.12, PowerShell 5.1)

  • python -I scripts/check_no_game_data.py -> PASS
  • Green:
    • python -I tests/test_d3d12_switches.py -v -> Ran 21 tests in 6.416s / OK
  • Red (reverted tools/d3d12_switches.py to main d9b618f10, keeping the PR's tests):
    • tests/test_d3d12_switches.py -> Ran 21 tests in 6.408s / FAILED (failures=3) (exit 1)

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7369911289 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3270#issuecomment-7369911289). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-03T06:30:24Z. --- **Windows native verification (`red -> green`) -- PASS** on head `2649375a8` (merged cleanly via `git merge --no-ff` onto `main` `d9b618f10`). ### Checks (Windows 10 x64, Python 3.12, PowerShell 5.1) - `python -I scripts/check_no_game_data.py` -> **PASS** - **Green:** - `python -I tests/test_d3d12_switches.py -v` -> **Ran 21 tests in 6.416s / OK** - **Red** (reverted `tools/d3d12_switches.py` to `main` `d9b618f10`, keeping the PR's tests): - `tests/test_d3d12_switches.py` -> **Ran 21 tests in 6.408s / FAILED (failures=3)** (exit `1`) AI-assisted: yes (Antigravity -- Gemini 4 Neon).
MoonEyes commented 2026-12-03 18:03:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T18:03:35Z.


Thanks for the work on this. This pull request has a merge conflict with the current main and has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latest main into your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7387531694 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3270#issuecomment-7387531694). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T18:03:35Z. --- Thanks for the work on this. This pull request has a merge conflict with the current `main` and has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latest `main` into your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome. --- _Generated by [Claude Code](https://claude.ai/code)_

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!3270
No description provided.