No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!152
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/152/head"
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?
@QuentinDanblon on GitHub · 2026-11-22 16:18 UTC · original
QuentinDanblon:contrib/all-in-one→main· +4841 −74 · 25 files · 6 commits · closed without mergingLibrary / area: tombox-xshader, d3d12_xs, compat-common (GameInput)
Exports changed (exports.txt rows): none
Source of the behaviour: RDNA2 ISA, LLVM AMDGPU (gfx1013), AMD machine-readable ISA specification, Mesa and LLPC (reference only), measurements on an RTX 5090, and results measured on AMD RDNA hardware published by the Leonida project (facts only, no code).
THIRD_PARTY/CREDITSis updated in the last commit.Thanks for merging #36 and #61. This carries four of the pull requests you asked me to resubmit (#47, #49, #55, #58), rebased on
f10db75with your requests applied, plus one new change. It is a single pull request with one commit per change, so that you have one place to look. If you prefer separate pull requests, say so and I will split it. #48 is left out, the reason is at the end.No comment lines are added (PR gate run locally: 25 files checked, 0 problems). No commit message or code names a title, a game corpus or a GPL-2.0 project.
Commits
c0ebb9dtests/isa_table.rs): 17 decoder names and 5 GFX7 lowerings correctedtools/progresschange, comment lines removed. Ingcn.rstheimage_atomic_rsubrefusal sits next to the R128 / TFE / LWE refusals ofd585b947f9c1d60b726e7merged_wave_infoin s3,GS_ALLOC_REQfield widths per the ISA3526327(local allocation counts), both changes keptf14fbeedevice_wrap.rs(keepstitle_layout_sizeandres3d::note_create)560c8e7TOMBOX_PAD_XINPUT/pad_xinput,TOMBOX_PAD_KEYS/pad_keys)gamepad.rs: host changes go through the new reading history, soGetNextReading/GetPreviousReadingsee them like scripted ones (one test added). Comment lines removed,tools/dev/pad.ps1not touched2f1cfd0THIRD_PARTY/CREDITS: LLVM and AMD ISA specification lines for the opcode tables, Leonida line extended to the new vectors. Kept apart so that the code commits do not conflict on that fileFiles:
0b726e7touches onlyhlsl/mesh.rsandtests/mesh.rs,f14fbeeonlyd3d12_xs,560c8e7onlycompat-common.c0ebb9dand7f9c1d6both touchrdna2.rsandtests/exec.rs.Notes per commit
7f9c1d6(new). The vectors are results an RX 6800 (gfx1030) returned, published in the comments of Leonida's GPU test programs (GPL-3.0). Its NaN vectors were taken with the hw-oracle tool of the AnyPS5 project. Only facts are used (instruction, input bits, measured bits); encodings come fromllvm-mc -mcpu=gfx1013. 46 of the 60 cases already passed on main. The 14 others:getLit16Encoding).v_pack_b32_f16andv_cvt_f32_f16read the f32 bit pattern, OPSEL on a constant read the constant again instead of +0.0, and 1/2pi is the f160x3118.v_med3_f32with a NaN operand is MIN3 with the NaN ignored (RDNA2 ISA):med3(NaN, 7, 5)is 5, was 7.isInt<21>on GFX9+), and soffset and the immediate are each truncated to a multiple of 4 before they are added. A negative immediate without SOFFSET is refused.f14fbee(#55). The failure was first documented by the americas-recomp project (GPL-2.0). Only the behavioural fact is used, the code is independent; #55 has the context. The hardware test for your side:cargo test -p d3d12_xs --release --lib hw_rgb9e5 -- --ignored. It skips on WARP, which supports the format natively.560c8e7(#47). The one change #47 made totools/dev/pad.ps1, for when you regenerate it, was a line in the help output:host input (a real XInput pad, keyboard WASD/arrows/Space... while the title window is focused) feeds the same pad; a running script, or a scripted 'down' not yet released, masks it (compat-common pad_host.rs).Results
Run on
2f1cfd0(this branch onf10db75), Windows 11, RTX 5090,--release.TOMBOX_EXEC_HW=1)cargo test -p tombox-xshader, all targets--test exec--test isa_sweep--test mesh/centroidcompat-commonlib 33 passed (filtered on the pad, GameInput and host input tests),gameinput_ext3 passed.d3d12_xshardware tests (hw_, ignored by default): 39 passed,hw_rgb9e5_typed_uav_texture_is_substitutedincluded.d3d12_xs --lib: 482 passed, 2 failed, 40 ignored. The same two tests fail onf10db75without this branch (471 passed, 2 failed, 39 ignored):xs_exports::console_fixed_tests::fixed_result_dxgix_exports_match_every_console_d3d12_xsanddevice_console_fix::tests::console_heap_properties_create_on_pc_through_every_wrapped_path. On9ab6f59, in a debug build, the first failed and the second passed, with and without this branch.Not included
#48 (XTaskQueue / XAsync conformance tests). I reran it as you asked, on
9ab6f59. The 24DIFFERSentries still hold, each run in its own process (22 fail, one does not return, one fails only under load). But the default run is not stable: with that commit alone on9ab6f59, 1 of 12 serial runs and 1 of 12 parallel runs failed, inverify_async_block_reuseorverify_simple_async_call, becauseXAsyncGetStatus(wait)returned before the completion callback had run.verify_no_write_after_get_status_racealso failed in 2 of 5 runs of the whole suite, with the async block written after the wait returned.gdk/rt.rsis unchanged since6741468. I will resubmit it when the default run is deterministic.#72, to resubmit after #41 as you said.
cargo test -p tombox-xshaderpasses on WARPNo game or console files and no binaries included
No fake success; anything not possible is left
missingwith a note🤖 Generated with Claude Code
A FidelityFX upscaler library built for the console creates a 1920x1080 R9G9B9E5_SHAREDEXP texture with ALLOW_UNORDERED_ACCESS (device slot 76). RDNA2 consoles accept it. NVIDIA rejects it with E_INVALIDARG because the format lacks FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW, and ffxCreateContext throws. The code is an independent implementation. Where the failure was first observed is in the pull request text. Measured on this machine with CheckFeatureSupport(FORMAT_SUPPORT): - RTX 5090 and UHD 770: R9G9B9E5 Support1=0x8013f0, so CreateCommittedResource with ALLOW_UAV returns 0x80070057. - WARP: Support1=0x2ecd3f1, and it accepts the texture. - 85/86/115/191 (B5G6R5, B5G5R5A1, B4G4R4A4, A4B4G4R4) are the only other formats that WARP binds as typed UAVs and NVIDIA/Intel do not. They are left alone: there is no console evidence for them and no exact wider container. R16G16B16A16_FLOAT is an exact container for RGB9E5. Every channel value m*2^(e-24) (m<512, e<=31, max 65408) is an f16; a unit test checks all 16384. uav_subst.rs: - Decision gated on the host's real Support1. Unknown support never substitutes. - Substitution applied in CreateCommittedResource (27, also reached by 76/83), CreatePlacedResource (29) and CreatePlacedResourceX (44, which then gets its own committed resource because the wider texture must not alias the title's neighbouring VA placements). - CPU-visible heaps are refused so that Map/Read/WriteToSubresource never see 8-byte texels. - Per-resource registry, validated against GetDesc. - SRV/UAV/RTV descriptors whose format is R9G9B9E5 are rewritten through a hook on the real device's method table (18/19/20), installed with the first substitution. That one point covers wrapper slots, placed-view slots, title_heap and titles that hold the real device. SRV swizzles that read source alpha are forced to 1, as an RGB9E5 read returns. - GetResourceAllocationInfo sizes substituted descs at 8 bytes per texel. - Title-memory mirroring (upload.rs) widens console RGB9E5 texels to RGBA16F while de-tiling. - On the Xbox command list, copies between a substituted texture and an R9G9B9E5 footprint or an unsubstituted texture are refused and logged; they are never forwarded as corrupt data. Substitute-to-substitute copies pass. Not mapped: - Shader UAV stores keep f16 values: more precise, within one RGB9E5 quantum, with no clamp of negatives/NaN/>65408. - Typed UAV loads return the stored alpha. - Reserved resources are not substituted. Tests: - Unit tests for the decision table, desc/view rewrite, swizzle, copy rules, conversions and the widening de-tile. - hw_rgb9e5_typed_uav_texture_is_substituted goes through slot 76, writes with a UAV compute shader and reads back through an SRV. - On the RTX 5090: 512 texels are exact, 512 more are within one quantum, and the refusal of the console-footprint copy is checked. - The test skips on WARP, which supports the format natively. - With the debug layer it reports only the intended host rejection. Co-Authored-By: Claude Fable 5.2 <[email protected]>@omonkeyz on GitHub · 2026-11-22 16:26 UTC · original
Thanks for resubmitting all of this on current main, and for the hardware-measured vectors! At about 4,800 lines across compat-common (pad host), d3d12_xs (UAV substitution, upload.rs, device_wrap) and the shader translator, it's too large to review and land as one change. Please split it into small PRs of a few hundred lines each, one topic per PR, each with its own tests:
isa_tablevectors that check them. The largegfx1013.txt/gfx7.txttables can go in with the first translator PR that uses them.uav_substchange on its own. It touches the d3d12_xs hot path, so please include its cost on a draw-heavy workload or a micro-bench.upload.rschanges on their own. Note that #146 just landed there and #153 is under review.Please keep each new THIRD_PARTY/CREDITS line with the PR that uses it.
@MiguelMatMar on GitHub · 2026-11-22 17:57 UTC · original
Ran this on Windows 11, MSVC, NVIDIA Ada / RTX 40-series (a second NVIDIA generation besides your RTX 5090), each tree with its own target dir.
On the branch itself (
2f1cfd0) everything passes:TOMBOX_EXEC_HW=1)--test exec--test isa_sweepcargo test -p tombox-xshader, all targetsd3d12_xs hw_rgb9e5_typed_uav_texture_is_substitutedSupport1=0x8013f0), so the substitution path really ranMerged onto main
0a9ebcd(only conflict: the Leonida / TomBox lines inTHIRD_PARTY/CREDITS, keeping both sides' additions),exec(99 passed) andisa_sweep(541) still pass on WARP and hardware, butisa_table::gcn_lowering_keeps_instructionfails:Those are the intended lowerings from #140 and #141, which landed after this branch was cut. Adding them to
gfx7_equivalentintests/isa_table.rsfixes it:With that,
isa_tablepasses 3/3 and the rest of thetombox-xshadersuites pass too (16 suites, 213 tests, 0 failed).Heads-up: against the newest main (
1e77fcc) the branch now also conflicts incrates/compat/d3d12_xs/src/device_wrap.rsandupload.rs, so it will need a rebase anyway.@QuentinDanblon on GitHub · 2026-11-23 01:16 UTC · original
Split as you asked, one topic per PR, each with its tests:
merged_wave_infoin s3,GS_ALLOC_REQwidths (was #58), written for the two-pass path of 256-thread shadersv_med3_f32with a NaN operandisa_tablefailure this PR had after #140 and #141. Thanks to MiguelMatMar for the run on a second NVIDIA generation and for the three equivalence lines, they are in #201 and the commit message names the source.smem_bounds.rs. Main now truncates soffset and the immediate, so that part is dropped and only the signed immediate is left: three of the RX 6800 vectors still return 0 on2eda8b0.THIRD_PARTY/CREDITSline is in the PR that uses it (#201 and #206). #202 and #203 put their tests intests/exec_vop/leonida.rs, which the existing Leonida line already covers.Still to come, as separate PRs:
uav_subst(was #55) with its cost on a draw-heavy workload or a micro-bench, then theupload.rschange on its own. Both need the GPU.Closing this one in favour of the PRs above.
Pull request closed