D3D12.X: a view-by-address desc's padding is zeroed before it keys a texture #3000
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!3000
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3000"
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?
@voiceovarian1-max on GitHub · 2026-11-27 11:14 UTC · original
voiceovarian1-max:pr/view-desc-padding→main· +33 −3 · 1 files · 1 commits · draftresource_atmakes one PC texture per address and desc for a title's views by address, keyed by the PC part of the desc. The 4 bytes after the dimension are padding (before the 8-byteAlignment) and hold whatever the title's stack held there, so the same texture at the same address was made again for each value: in a retail title's world, 19,780 of 65,536 texture creations by address. The key (view_desc_key) now zeroes that padding as well as the padding after the flags.What is in it
hle/d3d12x/real.rs:view_desc_key, used byresource_at, and the testview_desc_padding_does_not_change_the_key.Tested
x86_64-pc-windows-gnu, release; head001bf96a074don main623d02e4.cargo test -p xcl --lib view_desc(under Wine): 2 passed, 0 failed. Without the change the new test fails (1 failed).Regression run
scripts/smoke.ps1needs Windows, and we only have Linux. A Windows run of smoke on main and on this head would be welcome.Not tested
AI use
🤖 Generated with Claude Code
@Alm0stSurely on GitHub · 2026-11-27 11:38 UTC · original
RTX 5080, driver 620.73.04, Proton Experimental, Series X profile. We tested the cache-key change at
001bf96aon our #2057 (70a7e1d5) integration with a local port of #2306. #2762 covers the same four padding bytes. The focused test failed on the old key and passed on the patched key.In a 660 s title run,
resource_atreturned a cached, non-null texture 110,751 times. We could compare 96,848 hits to the description recorded when that same object was created. Bytes0x04..0x08matched on every one of those hits. The diagnostic table filled at 65,536 keys, leaving 13,903 hits unclassified and 12,001 creation events beyond capacity. This measures reuse calls and cannot quantify allocations saved or rule out padding differences among the unclassified hits.With the same save, driver and cache seeds as the unpatched control, both runs passed the credits and showed the cellmate tutorial over uniform gray. The 790 × 510 scene crop stayed pixel-identical in all 15 captures around forward/backward and camera inputs in each run. We still have no visible gameplay on this setup. This is an integration result, separate from the clean-main regression run.
AI-assisted testing and write-up with OpenAI Codex (
gpt-6.2-astra).@Royalflamejlh on GitHub · 2026-11-27 11:58 UTC · original
The Windows regression run the description asks for:
scripts/smoke.ps1on an RTX 2070 SUPER 8 GB,main623d02e4and this head001bf96ain turn, 2 runs each, showed no regression: 60 presents per 2 s at the end, no crash and no device removal in all four runs.Setup: Windows 11 Pro 26200, RTX 2070 SUPER 8 GB, driver 621.01, Ryzen 7 5700X3D, 16 GB RAM, rustc 1.100.0, release;
XCL_PREPARE=0in all four runs (the shader preparation left out, as #2976 allows, so that the 60 s are the title's).main623d02e4001bf96amain623d02e4001bf96aThe blocks of runs 3 and 4, for Regression run:
496ef578, open since 26 November) makes the same change: itsview_keyzeroes0x04..0x08and0x34... On #2762 we measured it under Wine on an RTX 4070, onmainb49be18+ #684, 3 runs of each key: 41,136 to 41,369 textures kept at 118 s, against 59,564 to 60,240 with the old key (#2762). #2762 also logs that count underXCL_ACTIVITY.view_desc_key(real.rs:2366) zeroes0x04..0x08(the padding betweenDimensionand the 8-byteAlignmentofD3D12_RESOURCE_DESC) and0x34..0x38(afterFlags), andresource_atkeysMADEwith it (real.rs:2380). No field ofD3D12_RESOURCE_DESCis in either range.Not tested: the title's world, where the duplicates were counted (
smoke.ps1presses nothing, so these 60 s stayed on the first screens); the texture count on Windows; the pull request's test; Linux at this head; AMD.AI use: Claude Code (Claude Opus 5.5) ran the smoke runs, read the diff and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
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.