D3D12.X: unmodelled console resource and counter-set creators fail visibly #3161

Open
KOLESNiii wants to merge 1 commit from upstream-pr/3161 into main
KOLESNiii commented 2026-11-28 14:35:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T14:35:10Z.


Status: a guess that needs evidence before it can be merged. Which methods device slots #45, #77 and #82 are, and where their out pointers are is reasoned from how titles call the API and from the PC's D3D12; it is not taken from any console documentation, and no title has confirmed it yet. Draft until then.

Evidence that would confirm it: on main this slot is a logged stub, so a title that calls it shows ID3D12Device::#45 in xcl.log and in report.json's stubs; an XCL_D3D12_TRACE=1 run of such a title shows its arguments (and #77, #82). The retail game used for the regression run does not get there.

If you run a title that gets there, please post those lines here (not the whole log, which names your paths).

Device #45 and #77 create a resource whose planes and metadata sit at separate GPU addresses: #45 takes the PC resource desc, #77 the console desc. Device #82 creates a performance-counter set. All three were logging stubs that returned S_OK without writing their out pointer, so a title carried on with whatever its out variable held. They now fail visibly with E_NOTIMPL.

What is in it

  • device_x.rs create_resource_at_planes_x (#45) and create_resource_at_planes_console_desc_x (#77): E_NOTIMPL, with a null written through the out pointer (the last of their seven arguments).

  • device_x.rs create_counter_set_x (#82): E_NOTIMPL. Where its out pointer sits is not known, so nothing is written.

  • Each logs one line per slot. They are wired in real.rs's device console slots.

Other unwired device slots (#46/#47 views with the console view desc, #59 default MSAA parameters, #68 GPU hardware configuration) are left as they are. Their argument layout could not be confirmed here, and no title on this PC calls them.

Tested

  • NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0 MSVC; tests in debug

  • Rebased onto main 309c3ec5 (main's MSAA test fix) on 2026-11-28. cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 on b7c894d5: 2143 passed, 0 failed, 48 ignored; 25 SKIPPED (21 no wave64, 3 refused #1426 forms, 1 no heap windows).

  • New test device_x::tests::unmodelled_object_creators_return_e_notimpl_and_a_null_object: ok. It tests the new functions.

Regression run

RTX 2070 SUPER, the retail game, 60 s, XCL_PRESS_AT=25:A, XCL_PREPARE=0 (no startup shader preparation), release builds, one queue job (main, then #3161) with the same starting DXIL cache for every run.

main:


xcl-smoke v1

commit: 309c3ec5a25ea231ddbe01f76748ab8ed3d9d953

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1297 (PresentX 1298)

presents per 2 s (last 3): 60 60 61

device removals: 0

crashes: 0

peak commit: 14701 MB

This PR's head:


xcl-smoke v1

commit: b7c894d5e4e63b4229396c6a5da19ca599376781

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1332 (PresentX 1332)

presents per 2 s (last 3): 60 60 60

device removals: 0

crashes: 0

peak commit: 14832 MB

Not tested

  • A title that calls #45, #77 or #82: none on this PC. The retail game calls none of them, so the smoke run does not reach this code.

  • The regression runs skip startup shader preparation (XCL_PREPARE=0), on main and on this PR alike.

  • AMD GPUs.

AI use

  • Claude Code, Claude Opus 5.5 (earlier steps of this session ran on Claude Sonnet 5.5): wrote the code, the test and this description; ran the tests.

  • Claude Code (Claude Opus 5.5) rebased it onto main 309c3ec5, ran the suite and the regression runs and updated this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5541203627 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3161). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T14:35:10Z. --- **Status: a guess that needs evidence before it can be merged.** Which methods device slots #45, #77 and #82 are, and where their out pointers are is reasoned from how titles call the API and from the PC's D3D12; it is not taken from any console documentation, and no title has confirmed it yet. Draft until then. **Evidence that would confirm it:** on `main` this slot is a logged stub, so a title that calls it shows `ID3D12Device::#45` in `xcl.log` and in `report.json`'s stubs; an `XCL_D3D12_TRACE=1` run of such a title shows its arguments (and `#77`, `#82`). The retail game used for the regression run does not get there. If you run a title that gets there, please post those lines here (not the whole log, which names your paths). Device #45 and #77 create a resource whose planes and metadata sit at separate GPU addresses: #45 takes the PC resource desc, #77 the console desc. Device #82 creates a performance-counter set. All three were logging stubs that returned S_OK without writing their out pointer, so a title carried on with whatever its out variable held. They now fail visibly with E_NOTIMPL. **What is in it** - `device_x.rs` `create_resource_at_planes_x` (#45) and `create_resource_at_planes_console_desc_x` (#77): E_NOTIMPL, with a null written through the out pointer (the last of their seven arguments). - `device_x.rs` `create_counter_set_x` (#82): E_NOTIMPL. Where its out pointer sits is not known, so nothing is written. - Each logs one line per slot. They are wired in `real.rs`'s device console slots. Other unwired device slots (#46/#47 views with the console view desc, #59 default MSAA parameters, #68 GPU hardware configuration) are left as they are. Their argument layout could not be confirmed here, and no title on this PC calls them. **Tested** - NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0 MSVC; tests in debug - Rebased onto `main` `309c3ec5` (`main`'s MSAA test fix) on 2026-11-28. `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` on `b7c894d5`: 2143 passed, 0 failed, 48 ignored; 25 SKIPPED (21 `no wave64`, 3 refused #1426 forms, 1 `no heap windows`). - New test `device_x::tests::unmodelled_object_creators_return_e_notimpl_and_a_null_object`: ok. It tests the new functions. **Regression run** RTX 2070 SUPER, the retail game, 60 s, `XCL_PRESS_AT=25:A`, `XCL_PREPARE=0` (no startup shader preparation), release builds, one queue job (`main`, then #3161) with the same starting DXIL cache for every run. `main`: ``` xcl-smoke v1 commit: 309c3ec5a25ea231ddbe01f76748ab8ed3d9d953 gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1297 (PresentX 1298) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 14701 MB ``` This PR's head: ``` xcl-smoke v1 commit: b7c894d5e4e63b4229396c6a5da19ca599376781 gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1332 (PresentX 1332) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14832 MB ``` **Not tested** - A title that calls #45, #77 or #82: none on this PC. The retail game calls none of them, so the smoke run does not reach this code. - The regression runs skip startup shader preparation (`XCL_PREPARE=0`), on `main` and on this PR alike. - AMD GPUs. **AI use** - Claude Code, Claude Opus 5.5 (earlier steps of this session ran on Claude Sonnet 5.5): wrote the code, the test and this description; ran the tests. - Claude Code (Claude Opus 5.5) rebased it onto `main` `309c3ec5`, ran the suite and the regression runs and updated this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
JJAutoCompare commented 2026-11-28 16:26:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T16:26:34Z.


Tested

Independently reran the pinned xcl library test executable for b7c894d5e4e63b4229396c6a5da19ca599376781 on Windows 11 x64 build 26200.9974 with a Ryzen 7 3800X. The executable was built with Rust 1.100.1 (x86_64 MSVC) from the exact-head source plus one private #[cfg(test)] fixture. I verified the source provenance and reran the existing binary.

xcl-8941870b96d3eddf.exe hle::d3d12x::real::pr3161_slot_verification::unsupported_creators_use_production_device_slots --exact --nocapture --test-threads=1
xcl-8941870b96d3eddf.exe hle::d3d12x::device_x::tests::unmodelled_object_creators_return_e_notimpl_and_a_null_object --exact --nocapture --test-threads=1

Both native processes exited 0. Total was 2 passed, 0 failed, 0 ignored, 0 skipped. Slots 45, 77, and 82 each occurred once in the production console device slot table and matched their typed handlers. Calls through those entries returned E_NOTIMPL (0x80004001). Slots 45 and 77 cleared the output cell while preserving both guards and the marker. They also returned E_NOTIMPL when given a null output parameter. The fixture called slot 82 with its declared receiver argument.

Not tested

Live vtable adoption, COM devices, undocumented slot 82 output ABI, GPU, title smoke, and the workspace suite.

AI use

T3 Code through Codex (gpt-6.2-sol, high) prepared the private fixture, verified the source and executable pins, independently reran both tests, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7242246223 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3161#issuecomment-7242246223). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-28T16:26:34Z. --- **Tested** Independently reran the pinned xcl library test executable for `b7c894d5e4e63b4229396c6a5da19ca599376781` on Windows 11 x64 build 26200.9974 with a Ryzen 7 3800X. The executable was built with Rust 1.100.1 (x86_64 MSVC) from the exact-head source plus one private `#[cfg(test)]` fixture. I verified the source provenance and reran the existing binary. ```text xcl-8941870b96d3eddf.exe hle::d3d12x::real::pr3161_slot_verification::unsupported_creators_use_production_device_slots --exact --nocapture --test-threads=1 xcl-8941870b96d3eddf.exe hle::d3d12x::device_x::tests::unmodelled_object_creators_return_e_notimpl_and_a_null_object --exact --nocapture --test-threads=1 ``` Both native processes exited 0. Total was 2 passed, 0 failed, 0 ignored, 0 skipped. Slots 45, 77, and 82 each occurred once in the production console device slot table and matched their typed handlers. Calls through those entries returned `E_NOTIMPL` (`0x80004001`). Slots 45 and 77 cleared the output cell while preserving both guards and the marker. They also returned `E_NOTIMPL` when given a null output parameter. The fixture called slot 82 with its declared receiver argument. **Not tested** Live vtable adoption, COM devices, undocumented slot 82 output ABI, GPU, title smoke, and the workspace suite. **AI use** T3 Code through Codex (`gpt-6.2-sol`, high) prepared the private fixture, verified the source and executable pins, independently reran both tests, and drafted this report.
Foniass commented 2026-12-01 09:39:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:39:15Z.


Triage (#1607) – head ca739fb

No open or merged PR maps device slots #45, #77 or #82. The author's related device-slot PRs (#3135 for #83-#126, #3136 for the *1 / *2 resource methods, #3144 for #124) cover other slots.
No problems found in the diff. The slot meanings and the argument layout of #45 / #77 are inferred, not confirmed by a title. A title that ignored the old S_OK stub's result will now see E_NOTIMPL, which is the intent.
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:7307011206 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3161#issuecomment-7307011206). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:39:15Z. --- **Triage (#1607)** – head ca739fb No open or merged PR maps device slots #45, #77 or #82. The author's related device-slot PRs (#3135 for #83-#126, #3136 for the *1 / *2 resource methods, #3144 for #124) cover other slots. No problems found in the diff. The slot meanings and the argument layout of #45 / #77 are inferred, not confirmed by a title. A title that ignored the old S_OK stub's result will now see E_NOTIMPL, which is the intent. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 10:02:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:02:01Z.


Review (head ca739fb, diff read, not a merge-check; draft, PR description red: its smoke block names b7c894d5):

  • A guessed argument position can write into the title's stack. #45 and #77 write a null through their 7th argument (device_x.rs ~590, ~598). That argument is on the stack, and no title has been seen calling these slots. If the real method takes fewer arguments, out is whatever the caller left there, and is_null() doesn't catch that. Main's stub writes nothing. Returning E_NOTIMPL without writing would keep the visible failure without that risk.
  • Where do the names and argument lists come from? Neither "a resource at per-plane GPU addresses" (with a console-desc variant) nor a "performance-counter set" exists on PC D3D12, and no title calls these slots. Please say how they were obtained.
  • Behaviour change. On main, #45, #77 and #82 reach the logged console-extension stub, which returns S_OK and leaves the output alone (real.rs, console_extensions ~1532). A title that ignores the result, for example a profiling counter set at #82, now takes an error path (unverified that any does).
  • The test only shows the new functions exist. It doesn't check the slot wiring (real.rs ~1588, ~1605, ~1612).
  • The red CI run is a uma_driver test that couldn't restore the coherent window and ended the lib test binary; main at 493dbd3d is green. A rerun should tell.

Fine: logged once per slot, and the slot numbers don't collide with existing device slots.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7307567284 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3161#issuecomment-7307567284). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:02:01Z. --- Review (head ca739fb, diff read, not a merge-check; draft, `PR description` red: its smoke block names b7c894d5): - **A guessed argument position can write into the title's stack.** #45 and #77 write a null through their 7th argument (`device_x.rs` ~590, ~598). That argument is on the stack, and no title has been seen calling these slots. If the real method takes fewer arguments, `out` is whatever the caller left there, and `is_null()` doesn't catch that. Main's stub writes nothing. Returning E_NOTIMPL without writing would keep the visible failure without that risk. - **Where do the names and argument lists come from?** Neither "a resource at per-plane GPU addresses" (with a console-desc variant) nor a "performance-counter set" exists on PC D3D12, and no title calls these slots. Please say how they were obtained. - **Behaviour change.** On main, #45, #77 and #82 reach the logged console-extension stub, which returns S_OK and leaves the output alone (`real.rs`, `console_extensions` ~1532). A title that ignores the result, for example a profiling counter set at #82, now takes an error path (unverified that any does). - **The test only shows the new functions exist.** It doesn't check the slot wiring (`real.rs` ~1588, ~1605, ~1612). - The red CI run is a `uma_driver` test that couldn't restore the coherent window and ended the lib test binary; main at 493dbd3d is green. A rerun should tell. Fine: logged once per slot, and the slot numbers don't collide with existing device slots. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
KOLESNiii commented 2026-12-02 14:47:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-12-02T14:47:01Z.


@Foniass fixed: #45 and #77 no longer write through the seventh argument. All three stubs now return E_NOTIMPL and write nothing, because no title has been seen calling them, so where their out pointers sit is not known (device_x.rs). The test calls them with the seven arguments they were thought to take and checks the seventh is left alone. It fails on the previous head. New head 06b8ac0c (rebased onto main df0cfef6, which also takes care of the red CI run). How the slot / field meanings were obtained is a question for the PR author, who will answer it here; I have not changed them.

— Claude Code (Claude Opus 5.5), on behalf of the PR author

<!-- greyfinch-sync:ivall/xcl:comment:7349130648 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3161#issuecomment-7349130648). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-12-02T14:47:01Z. --- @Foniass fixed: #45 and #77 no longer write through the seventh argument. All three stubs now return E_NOTIMPL and write nothing, because no title has been seen calling them, so where their out pointers sit is not known (`device_x.rs`). The test calls them with the seven arguments they were thought to take and checks the seventh is left alone. It fails on the previous head. New head `06b8ac0c` (rebased onto `main` df0cfef6, which also takes care of the red CI run). How the slot / field meanings were obtained is a question for the PR author, who will answer it here; I have not changed them. — Claude Code (Claude Opus 5.5), on behalf of the PR author
Foniass commented 2026-12-02 14:49:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T14:49:10Z.


Follow-up review (head 06b8ac0c, since ca739fb, diff read, not a merge-check; draft, checks red):

  • A guessed argument position can write into the title's stack: fixed. #45, #77 and #82 now take only this and return E_NOTIMPL without writing anything (device_x.rs), and unmodelled_object_creators_return_e_notimpl_and_write_nothing calls #45 / #77 with seven arguments and checks the out value is left alone.
  • Where the names and argument lists come from: partly fixed; the doc comment now says no title has been seen calling them, but the slot meanings are still not sourced.
  • Behaviour change (S_OK becomes E_NOTIMPL): unchanged, as intended.
  • The test only shows the new functions exist: unchanged; nothing checks the slot wiring in real.rs.

New: none.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7349192056 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3161#issuecomment-7349192056). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T14:49:10Z. --- Follow-up review (head 06b8ac0c, since ca739fb, diff read, not a merge-check; draft, checks red): - **A guessed argument position can write into the title's stack:** fixed. #45, #77 and #82 now take only `this` and return `E_NOTIMPL` without writing anything (`device_x.rs`), and `unmodelled_object_creators_return_e_notimpl_and_write_nothing` calls #45 / #77 with seven arguments and checks the out value is left alone. - **Where the names and argument lists come from:** partly fixed; the doc comment now says no title has been seen calling them, but the slot meanings are still not sourced. - **Behaviour change (S_OK becomes E_NOTIMPL):** unchanged, as intended. - **The test only shows the new functions exist:** unchanged; nothing checks the slot wiring in `real.rs`. New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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/3161:upstream-pr/3161'
git switch 'upstream-pr/3161'

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/3161'
git switch 'upstream-pr/3161'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3161'
git switch 'upstream-pr/3161'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3161'
git switch 'main'
git merge --squash 'upstream-pr/3161'
git switch 'main'
git merge --ff-only 'upstream-pr/3161'
git switch 'main'
git merge 'upstream-pr/3161'
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!3161
No description provided.