Scripts: keep the D3D12 layout when the header has no device #995
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1002"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by timorjay on 2026-11-24T10:14:36Z.
With the Windows SDK's
d3d12sdklayers.has input, the generator replaced the existing interface table with 6,947 bytes of debug interfaces, then failed because it could not find a device. A recognized device with no parsed methods could also replace the layout with an empty method list.What is in it
scripts/gen_d3d12_layout.pyfinds the device before opening the output and reports which header it expected.scripts/test_gen_d3d12_layout.pychecks that a header without a device preserves an existing destination and leaves an absent destination absent.Tested
5c59a59,python -B -m unittest discover -s scripts -p "test_*.py" -vpassed 5/5. The prior heade08daa9created or replaced the layout in all six combinations of an empty device alone, empty derived device, or empty base device with an existing or missing output. The new head rejected all six and preserved the original state.5c59a59matchede08daa9byte for byte for Microsoft DirectX-Headers v1.614.1 (74 interfaces, 60,453 bytes) and61c77189(102 interfaces, 77,439 bytes), and for a valid synthetic base/derived pair.e08daa9, the Python suite passed 4/4. The original missing-device test failed on parent09940bb.d3d12.hfrom Windows SDK 10.0.26100 and Microsoft DirectX-Headers61c77189, output matched the parent byte for byte (81 and 102 interfaces). The latter also matched the table in Git.e08daa9,cargo build --locked --workspacepassed.cargo test --locked --workspace --no-fail-fast -- --test-threads=4: 715 passed, 1 failed, 41 ignored. Two of the 715 reportedSKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.test_title_runs_and_game_folder_is_untouchedfailed on both this commit and09940bb: the synthetic title exited successfully, butreport.called_stubswas empty.Not tested
e08daa9. Retail gameplay and other GPUs were outside these checks. The patch changes the generator and its test only.AI use
Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T10:35:37Z.
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@6efdabc(baseline 727 passed, 0 failed, 41 ignored on this box):Same count as the baseline (keeping the D3D12 layout when the header has no declaration), nothing regresses.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T11:34:08Z.
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X; Python 3, debug.
python scripts/test_gen_d3d12_layout.py: 1 test, OK — the new test feeds the generator a header withID3D12Debugbut no device interface, asserts it exits non-zero withexpected d3d12.h, that a pre-existing output file is left byte-identical, and that no new output is created. The 5-line generator change gates output writing on finding the device vtable.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-25T20:36:50Z.
Verified the fast-forward to
5c59a591123648efbf0fe4fa87d3366bfeac4f90, the original fork commit with RavenCurseBurg as author. On this upstream head the complete Python suite passed 5/5. I also reran six invalid-header CLI cases: an empty base only, an empty derived table with a populated base, and an empty base with a populated derived table, each with and without a previous output file. Every run preserved the existing bytes or left the missing path absent. A valid base/derived pair still generated both interface names and the expected methods. Windows 11, Core i7-13700, Python 3.14.3, no Rust or GPU run. OpenAI Codex (GPT-6) reran the checks.Earlier verification
Tested on
e08daa9c7a39068bd881e931d8b5f439e954c272, Windows 11 build 26100.9711, Core i7-13700, Python 3.14.3.python -I scripts/gen_d3d12_layout.py synthetic.h layout.rsreturned 0 and wrotemethods: &[]when a device IID and vtable name matched but the table had no parsed methods. I tested an empty device alone, an empty derived device alongside a populated base, and the reverse. In all three cases the generator also replaced a pre-existing output.The candidate fix and regression name the empty device and stop before opening the output. All six combinations of those headers with an existing or missing output preserved the previous bytes or left the path absent. A valid base/derived pair still generated correctly. With Microsoft's DirectX-Headers v1.614.1 desktop header, the original and candidate generated identical 60,453-byte files: 74 interfaces, 83 methods on
ID3D12Device14.python -B scripts/test_gen_d3d12_layout.pypassed 2/2 andpython -B -m unittest discover -s scriptspassed 5/5. Both new empty-device subcases failed against the PR head.Not tested — The Rust workspace or GPU runtime. OpenAI Codex (GPT-6) generated the fixtures, implemented and tested the candidate, and wrote this report.
Imported from ivall/xcl. Originally posted by timorjay on 2026-11-26T00:37:36Z.
Thanks for the reproducer and the patch. I fast-forwarded this PR to your original commit
5c59a59so your authorship is preserved. On Windows with Python 3.14.7, I reproduced the overwrite or unwanted file creation in all six cases one08daa9. The new head rejects all six, and the script suite passes 5/5. The generated layouts are byte-identical on both heads for Microsoft DirectX-Headers v1.614.1 and61c77189. The PR description records the commands and the revision of the previous GPU run.Codex-assisted reproduction and verification.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:32:07Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:42:07Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:37:03Z.
Triage (#1607) – head
5c59a59No merged change covers this: main's
gen_d3d12_layout.pystill writes the output and only then looks for a device. #1336 also edits this script and also addsscripts/test_gen_d3d12_layout.py, so the two conflict. #1336 refuses only a header with no ID3D12 interfaces at all. Withd3d12sdklayers.hit would still overwrite the table with the debug interfaces ("no device interface"), which is the case this PR rejects.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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.