Tests: compare the D3D12 answers with the host driver on the same machine (no console files needed) #480
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#480
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Luislariosss on GitHub · 2026-11-24 00:54 UTC · original
tests/xg_oracle.rscompares XCL against the console's ownxg_xs.dll(XCL_SAMPLE_XG), which is the right oracle for the console layout, but it needs console files, so it skips on a machine that has none. There is no test that compares XCL's answers with the PC driver on the same machine, and for the part of the API that D3D12.X shares with plain D3D12 that driver is also ground truth: if XCL'sGetResourceTiling,CreateReservedResourceorCheckFeatureSupportanswer something the driver would not, the title sees a difference that no console-file test would catch.Proposal: a small integration test that asks the host device and the XCL path the same question and compares. It needs no game data and no console DLL.
Measured expectations, so the test has something to assert
Plain D3D12 on this machine, no game files,
GetResourceTilingon a reserved resource created withD3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE:Two things worth pinning, both of which a hand-written tile formula would get wrong: the 8x8 case is one tile, not zero, and the tile shape depends on the format - BC1 reports 512x256 texels per tile where RGBA8 and D32 report 128x128.
What the test would do
ID3D12Device::CreateReservedResourcedirectly, once through the path the title'sCreateReservedResourcetakes inhle/d3d12x/vram.rs(which rewrites the layout and then callsdev_create_reserved_resource).GetResourceTilingof both and assert equaltotal_tiles,WidthInTiles,HeightInTilesandD3D12_TILE_SHAPE.CheckFeatureSupportover the request types XCL answers itself, comparing withD3D12_FEATURE_DATA_D3D12_OPTIONS*from the host device.If XCL decides to compute tiling rather than ask the driver (
vram.rs:490asks it today, so this may already hold), the numbers above are the ones to match on RDNA4.I have not opened a PR: I would rather know whether this is wanted, and which side should be the oracle where the console and the PC driver legitimately differ (a D3D12.X feature the PC has no equivalent for). If it is wanted, I can write it and paste a full
cargo test --workspacerun from this card (676 passed, 0 failed, 41 ignoredon2997c9aca).AI-assisted.
@Luislariosss on GitHub · 2026-11-24 01:11 UTC · original
One thing I checked before answering the design question, because it changes what the test can prove:
vram.rs:490already asks the driver —dev.GetResourceTiling(res, Some(&mut total), ...)— for the resource it creates. So step 2 of your proposal ("ask both and compare") compares XCL with the driver only if both queries are made on the same resource. They are not: the console path rewritesLayoutbefore callingdev_create_reserved_resource, so the two calls describe two different resources and equality is not the invariant.What I think the test should assert, in this order:
GetResourceTilingtwice — once through XCL's slot, once directly on the returnedID3D12Resource— and require identicaltotal_tiles,WidthInTiles,HeightInTilesandTILE_SHAPE. That catches XCL answering from a formula instead of the driver, without redefining what is correct.xg_oracle.rsand itsXCL_SAMPLE_XGskip, or in a documented exception in the test.So: host driver as oracle for anything the PC also executes, console as oracle for what only the console defines, and the measured RDNA4 numbers pinned as constants so a regression fails loudly instead of silently following whatever the driver says that day.
I am not the one who decides it — it is the author's call and yours — but if that split is what you want, I can write the test and paste a full
cargo test --workspacefrom this RX 9060 XT (677 passed, 0 failed, 41 ignored on2997c9aca).AI-assisted.
@razormontana on GitHub · 2026-11-24 18:02 UTC · original
I’m taking the
CreateCommandQueuehost-driver parity test. I’ll compare XCL’s queue hook with native D3D12 on the same adapter, including console flag translation, using synthetic inputs on my RTX 3070. Codex (GPT-6.2 Sol) is assisting.@CryingLaughing on GitHub · 2026-11-26 07:41 UTC · original
Taking the
DispatchXindirect-execution parity case for console argument type105. The planned RTX 4080 check covers the synthetic mapped-title path on currentmain, native and adopted-PC controls, and GPU readback of the dispatch output.