Scripts: validate GDK table GUIDs before generation #2714

Open
luckyteagirl wants to merge 3 commits from upstream-pr/2724 into main
luckyteagirl commented 2026-11-26 08:52:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T08:52:50Z.


Stacked on #2681

Validate both GUIDs in active GDK table rows before replacing the generated Rust table. The prerequisite filters commented rows first, so a malformed GUID in a disabled row does not stop regeneration.

What is in it

  • Require the canonical 8-4-4-4-12 hexadecimal form for class and interface GUIDs. A diagnostic names the row and field, and the existing output survives a rejected row.
  • Exercise malformed active GUIDs, including quoted // and /*...*/ markers. The stack follows the integration reviewed by RavenCurseBurg. Reviewer findings

Tested

  • On Windows 11 build 26200, the previous head aae8e433 rejected a commented-out bad//guid row. On the comment-filter-only prerequisite, the GUID fixture failed all five malformed-active-row cases. On e46d5135, python -B -m unittest discover -s scripts -p 'test_*.py' passed 27 tests with 0 failures.
  • Reconstructed the 396 rows from upstream c2ee10e4 as temporary input and added a disabled malformed row. The generated output matched the checked-in table byte for byte. git diff HEAD^ HEAD --check passed.

Regression run

This changes the Python generator and its tests. The checked-in Rust output is unchanged.

Not tested

A fresh GDK extraction, Rust or GPU tests, and a retail title run.

AI use

OpenAI Codex (GPT-6.2 Sol) implemented the original GUID validation and failing-first fixture. OpenAI Codex (GPT-6.2 Astra) reviewed the original diff and tested its composition with adjacent changes. RavenCurseBurg used OpenAI Codex (GPT-6) to prepare and test the integration and interface regression. OpenAI Codex (GPT-6, exact variant unavailable) prepared the local stack and verified its regression and regeneration results.

<!-- greyfinch-sync:ivall/xcl:issue:5506909601 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2724). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T08:52:50Z. --- Stacked on #2681 Validate both GUIDs in active GDK table rows before replacing the generated Rust table. The prerequisite filters commented rows first, so a malformed GUID in a disabled row does not stop regeneration. **What is in it** - Require the canonical `8-4-4-4-12` hexadecimal form for class and interface GUIDs. A diagnostic names the row and field, and the existing output survives a rejected row. - Exercise malformed active GUIDs, including quoted `//` and `/*...*/` markers. The stack follows the integration reviewed by RavenCurseBurg. [Reviewer findings](https://github.com/xcl-dev/xcl/pull/2724#issuecomment-7188439687) **Tested** - On Windows 11 build 26200, the previous head `aae8e433` rejected a commented-out `bad//guid` row. On the comment-filter-only prerequisite, the GUID fixture failed all five malformed-active-row cases. On `e46d5135`, `python -B -m unittest discover -s scripts -p 'test_*.py'` passed 27 tests with 0 failures. - Reconstructed the 396 rows from upstream `c2ee10e4` as temporary input and added a disabled malformed row. The generated output matched the checked-in table byte for byte. `git diff HEAD^ HEAD --check` passed. **Regression run** This changes the Python generator and its tests. The checked-in Rust output is unchanged. **Not tested** A fresh GDK extraction, Rust or GPU tests, and a retail title run. **AI use** OpenAI Codex (GPT-6.2 Sol) implemented the original GUID validation and failing-first fixture. OpenAI Codex (GPT-6.2 Astra) reviewed the original diff and tested its composition with adjacent changes. RavenCurseBurg used OpenAI Codex (GPT-6) to prepare and test the integration and interface regression. OpenAI Codex (GPT-6, exact variant unavailable) prepared the local stack and verified its regression and regeneration results.
RavenCurseBurg commented 2026-11-26 09:45:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T09:45:55Z.


I tested aae8e43308dad4df7c9fefd00c4250cd637e2f72 alongside #2681 at 499738640791. This head reports an invalid GUID from a disabled row. Integration candidate a6dd26db4ea5 applies luckyteagirl’s comment handling from #2681 before this PR’s active-row validation. On python -B scripts/gen_gdk_table.py <synthetic-table>, the candidate preserved the source URL, slot order and exact generated bytes after I inserted disabled entries. A malformed active class and a malformed active interface each produced a field-specific diagnostic and left the output unchanged.

python -B -m unittest discover -s scripts -p "test_*.py" passed all 27 tests on the integration commit. Windows build 26100, Core i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) wrote and ran the synthetic tests. Codex prepared the integration and added the interface fixture. The Windows GDK library and Rust runtime were outside this run.

Retest on e46d5135c2fe23291437c24ad0bd867ba85084c6

I reran python -B scripts/gen_gdk_table.py on the new head stacked on #2681. Adding disabled rows left the output byte-identical to the clean input’s output, including the source URL and slot order. Malformed active class and interface GUIDs each produced the expected field diagnostic and preserved the existing output. Python test discovery passed all 27 tests.

OpenAI Codex (GPT-6) ran the synthetic fixtures on Windows 11. No retail title, GPU workload or Rust workspace build was used.

<!-- greyfinch-sync:ivall/xcl:comment:7188439687 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2724#issuecomment-7188439687). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T09:45:55Z. --- I tested `aae8e43308dad4df7c9fefd00c4250cd637e2f72` alongside #2681 at `499738640791`. This head reports an invalid GUID from a disabled row. Integration candidate [a6dd26db4ea5](https://github.com/RavenCurseBurg/xcl/commit/a6dd26db4ea579c66adbaef9e0d73eb7c5699133) applies luckyteagirl’s comment handling from #2681 before this PR’s active-row validation. On `python -B scripts/gen_gdk_table.py <synthetic-table>`, the candidate preserved the source URL, slot order and exact generated bytes after I inserted disabled entries. A malformed active class and a malformed active interface each produced a field-specific diagnostic and left the output unchanged. `python -B -m unittest discover -s scripts -p "test_*.py"` passed all 27 tests on the integration commit. Windows build 26100, Core i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) wrote and ran the synthetic tests. Codex prepared the integration and added the interface fixture. The Windows GDK library and Rust runtime were outside this run. **Retest on `e46d5135c2fe23291437c24ad0bd867ba85084c6`** I reran `python -B scripts/gen_gdk_table.py` on the new head stacked on #2681. Adding disabled rows left the output byte-identical to the clean input’s output, including the source URL and slot order. Malformed active class and interface GUIDs each produced the expected field diagnostic and preserved the existing output. Python test discovery passed all 27 tests. OpenAI Codex (GPT-6) ran the synthetic fixtures on Windows 11. No retail title, GPU workload or Rust workspace build was used.
Foniass commented 2026-12-01 08:49:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:49:05Z.


Triage (#1607) – head e46d513

Stacked on #2681: the first two commits and scripts/test_gdk_table_comments.py are #2681's. Only e46d513 (GUID validation) belongs here. #2658 also adds a check to gen_gdk_table.py (slot <= 255), but a different one, so they only touch the same lines. #1267 restructures the same script and will conflict textually.
The new row regex takes any quoted field, and the canonical 8-4-4-4-12 check then rejects bad GUIDs before the output is opened, so a rejected input leaves the old table in place. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305824466 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2724#issuecomment-7305824466). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:49:05Z. --- **Triage (#1607)** – head e46d513 Stacked on #2681: the first two commits and `scripts/test_gdk_table_comments.py` are #2681's. Only e46d513 (GUID validation) belongs here. #2658 also adds a check to `gen_gdk_table.py` (slot <= 255), but a different one, so they only touch the same lines. #1267 restructures the same script and will conflict textually. The new row regex takes any quoted field, and the canonical 8-4-4-4-12 check then rejects bad GUIDs before the output is opened, so a rejected input leaves the old table in place. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2724:upstream-pr/2724'
git switch 'upstream-pr/2724'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2724'
git switch 'upstream-pr/2724'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2724'
git switch 'upstream-pr/2724'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2724'
git switch 'main'
git merge --squash 'upstream-pr/2724'
git switch 'main'
git merge --ff-only 'upstream-pr/2724'
git switch 'main'
git merge 'upstream-pr/2724'
git push origin 'main'
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
xcl-dev/xcl!2714
No description provided.