Repository navigation
Conversation
|
A test report from another card and another tree: the blue-white skin is gone with this patch. Tested
One thing I had to add on my line, which may matter here too: the patch changes the code a pixel program is translated from, not the blob the title hands over. Where the translated cache is keyed by that blob's hash, a translation cached before the patch is served as it was. I gave the cache identity a salt when the patches are on (every shader is translated again once, about 5 more minutes to the world on the first launch). I did not check how Not tested
AI use: Claude Code with Claude Fable 5.2 cherry-picked the commit, ran the tests and the runs on this machine, and wrote this report. No frame posted. |
|
I checked the 16-bit integer render-target case listed under “Not tested” on exact head The synthetic v0x101 FSSM had a header-located pixel program, a stored
All eight shaded texels per draw matched the value shown. The eight texels outside the scissor retained the clear value This establishes the PC output for these two representable values in a one-target synthetic shader. It does not compare against a console capture, cover out-of-range conversion, or establish whether a retail title uses these formats. AI use: OpenAI Codex built the test-only FSSM and typed render-target fixture, ran the controls, and wrote this report. |
|
A test report from GTA 6's intro cutscene (#505): with this patch the night, sunset and daylight shots are exposed far closer to correct. Tested
Seen, same shots, without the PR → with it
Not fixed / not attributable to this PR
AI use: test run and report by Claude Code, Claude Opus 5.5. |
|
A warm translated-shader cache can mask
The two cold translations differ as expected. In both warm processes the decoded instructions switched, but the returned DXIL still matched the first process. The translated cache uses the original Xbox container and translator build identity; toggling a runtime switch changes neither. A narrowly scoped correction is to bypass translated pixel cache reads and writes when the export patch is effectively disabled, leaving the default cache available. An explicitly mode-keyed pixel cache is another option. Until then, separate AI assistance: OpenAI Codex traced the production path, assembled the synthetic fixture, ran the four controls and drafted this comment. |
|
I tested a small candidate on Fresh processes calling
I also seeded a third cache with only a valid stored-mode entry under the old filename, using the candidate's exact translator identity and shader blob. An unset launch returned the patched hash and wrote a separate patched entry. This checks migration even when a build fingerprint change cannot hide stale entries. The patch preserves non-pixel filenames; as usual, changing a translator source can invalidate the build fingerprint. No retail or GPU run for this cache-only follow-up. Apply-checked against the pristine PR head. The following is the entire production patch. --- a/crates/xcl/src/gpu/xbox.rs
+++ b/crates/xcl/src/gpu/xbox.rs
@@ -364,7 +364,7 @@
}
/// `XCL_PS_EXPORT_PATCH=0` leaves pixel shaders' render-target exports as the compiler stored them.
-fn ps_exports_patched() -> bool {
+pub(crate) fn ps_exports_patched() -> bool {
static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
*ON.get_or_init(|| !std::env::var("XCL_PS_EXPORT_PATCH").is_ok_and(|v| v.trim() == "0"))
}
--- a/crates/xcl/src/gpu/recomp/pso.rs
+++ b/crates/xcl/src/gpu/recomp/pso.rs
@@ -374,10 +374,16 @@
}
pub(super) fn file(dir: &Path, ident: u64, blob: &[u8], stage: Stage, sampler_base: u32, windows: u32, split: bool) -> PathBuf {
+ // Older pixel entries do not identify the export mode that produced them.
+ let exports = match stage {
+ Stage::Pixel if crate::gpu::xbox::ps_exports_patched() => "_exports_patched",
+ Stage::Pixel => "_exports_stored",
+ _ => "",
+ };
dir.join("translated")
.join("v2")
.join(format!("{ident:016x}"))
- .join(format!("{:016x}_{stage:?}_{sampler_base}_{windows}_{}.bin", crate::gpu::shader::fnv64(blob), split as u8))
+ .join(format!("{:016x}_{stage:?}_{sampler_base}_{windows}_{}{exports}.bin", crate::gpu::shader::fnv64(blob), split as u8))
}
fn header(ident: u64, blob: &[u8]) -> Vec<u8> {AI assistance: OpenAI Codex implemented the candidate, ran the fresh-process controls, and wrote this report. |
Prime1997
left a comment
There was a problem hiding this comment.
Approving on a merge-check run on an RTX 3060 Ti 8 GB (driver 32.0.16.1714, i5-10400, Windows 11 Pro 26200, Rust 1.100.0).
- Head
e87826532e98a43353e255665ff19bf2bd93106cmerged cleanly ontomain7db2f391, and the workspace builds. cargo test --workspace --no-fail-fast -- --test-threads=4, with--skipfor threeuma_drivertests that can end the library harness on this PC on plainmaintoo: 2,593 passed, 0 failed, 49 ignored, 28 SKIPPED (21 of them no wave64).mainwith the same skips: 2,591 passed, 0 failed. Both new tests pass.- The cold case on an 8 GB card: a 420 s
scripts/smoke.ps1world run (scripted confirm presses, Series S profile,XCL_PREPARE=0, a private shader cache) gave 3,529 frames and a peak commit of 22,048 MB with this change, against 3,463 frames and 23,115 MB onmain. No device removal and no crash on either. Both stop presenting after about 240 s with some 83,000 pipelines in the build-ahead backlog, so that stall ismain's. One run a side. - 60 s smoke: 1,411 frames against 1,385 on
main, no device removal, no crash. xbox.rsread in full, no blocking finding. Not checked here: the picture itself; no frames were dumped on this card.- The red
Build and testrun on this head failed in one timing test,hle::kernelx::tests::fine_timer_makes_short_sleeps_short, which this change does not touch.
AI use: Claude Code ran the builds, tests and game runs on Prime's PC and wrote this text. Approving is Prime's decision.
I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord
e878265 to
6931baa
Compare
|
@andrewDoing thank you, both points taken.
The regression block in the description is rerun on the new head. Thanks also to @jessenic and @BBareth for the runs on their trees. AI use: Claude Code (Claude Opus 5.5) applied the change, ran the tests and the regression run, and wrote this reply. |
Prime1997
left a comment
There was a problem hiding this comment.
Approving again on the updated head, after a rerun on the same RTX 3060 Ti 8 GB (driver 32.0.16.1714).
- Head
6931baaf92e3693f0e48b023a5b368da27b713afmerged cleanly ontomain7db2f391, and the workspace builds. cargo test --workspace --no-fail-fast -- --test-threads=4with the same threeuma_drivertests skipped: 2,593 passed, 0 failed, 49 ignored, 28 SKIPPED. Same counts as on the previous head.- 60 s
scripts/smoke.ps1withXCL_PREPARE=0: 1,420 frames against 1,385 onmain, peak commit 15,283 MB against 15,626 MB, no device removal, no crash. - The 420 s cold-cache world run in my earlier review was made on the previous head
e8782653and was not repeated: the patch code is the same, and this update only adds the export mode to the translated-cache file name.
AI use: Claude Code ran the builds, tests and game runs on Prime's PC and wrote this text. Approving is Prime's decision.
I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord
|
Confirmed the squashed cache fix on 6931baa. Seven fresh Windows processes called the production console_to_dxil_in path with the same synthetic Xbox pixel shader. With one shared cache, unset → 0 → 1 returned patched → stored → patched DXIL. With a second cache, 0 → unset → 0 returned stored → patched → stored. The hashes were 5ad4c1e3259a2aa9 (patched) and 9be258cbc57a259c (stored). For the seventh launch I seeded a third cache with only the valid stored entry under the old unlabelled filename, in the current translator identity directory. Unset produced the patched hash and created its labelled entry alongside the legacy one. This closes my disk-cache finding on the author's implementation. Synthetic translation only; no new title or GPU run. OpenAI Codex prepared the test overlay, ran the controls and drafted this comment. |
6931baa to
bb0679f
Compare
|
Rebased onto #3200 was merged in the meantime and fixes the same symptom from the other side: it rewrites the FP16 export epilogue during translation for pipelines with 32-bit render targets, behind a liveness check. This PR applies the console's own export patch table while the FSSM is parsed, for every target and format. The two coexist; the only conflict was the translated-cache file name, which now carries both this PR's export mode and #3200's AI use: Claude Code (Claude Opus 5.5) did the rebase, ran the tests and the regression runs, and wrote this comment. |
bb0679f to
601481e
Compare
|
CI on AI use: Claude Code (Claude Opus 5.5) read the CI log, rebased, reran the tests and the regression run, and wrote this comment. |
A pixel shader's render-target exports are stored for one export format, the compiler's default FP16 (v_cvt_pkrtz_f16_f32 and a compressed exp). The console patches them at pipeline creation for each target's SPI_SHADER_COL_FORMAT from a table in the PS stage data: per render target, the code offset and ten variants of the export code. XCL never applied it, so a target of 32 bits a channel got the FP16 conversion of its value: a packed R32_UINT lighting target of a retail title held f16(asfloat(bits)), 0x7BFF where the packed value was large, instead of its bits. On screen: a blue-white glow on skin and lit surfaces. Every target is patched to the 32_ABGR variant: the channels leave the shader unconverted and the PC target converts them, which is right for every PC format. A table that is implausible (no PS record, a size of 0 or over ten dwords, a patch past the code, an empty variant) changes nothing. XCL_PS_EXPORT_PATCH=0 keeps the stored exports. The table layout (record at payload + 0x30, stage data at record + 0x54, size at + 0x148, eight entries from + 0x14C) is as VIctory documents it in victory-shader/src/native.rs (GPL-3.0); the code is written independently. THIRD_PARTY.md says so. A pixel shader's entry in the translated-shader cache names its export mode (translated::exports_mode): neither the shader's bytes nor the translator's identity record XCL_PS_EXPORT_PATCH, so a warm cache handed one mode's translation to the other. Older unlabelled pixel entries are not read. Found and fixed by andrewDoing in review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
601481e to
710a5f4
Compare
|
The PR is now at What changed since
@Prime1997 @andrewDoing, if you have time, a rerun on AI use: Claude Code (Claude Opus 5.5) compared the heads and wrote this comment. |
|
A data point for this PR, from an RTX 5070 Ti (driver 621.40). We tested a local port of the same idea, not this PR's code. Our tree is an older base that already has #3200. On top of it we apply the console's export patch table first: the 32_ABGR slot, for the render targets #3200's Result in the prologue cell, compared with #3200 alone, at the same shot:
The difference showed up after we fixed the tile lighting's material-class plane, which is described in #505. Since that fix, skin and cloth tiles go through the R32_UINT subsurface path. With #3200's pattern alone, some of those shaders still wrote the FP16 form. We have not narrowed down which ones, or which of #3200's liveness declines they hit. This is one run (360 s, no device removal), with the same switches as our earlier runs. Untested: AMD, and this PR's own code on AI-assisted. |
|
Review (head 710a5f4, diff read, not a merge-check; conflicts with main, a textual conflict next to
Fine:
It is on by default and runs in AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Main already handles 32-bit render targets per pipeline ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
A pixel shader's render-target exports are stored for one export format, the compiler's default FP16 (
v_cvt_pkrtz_f16_f32and a compressedexp). The console patches them at pipeline creation for each target'sSPI_SHADER_COL_FORMAT, from a table in the PS stage data. XCL never applied that table, so a target of 32 bits a channel got the FP16 conversion of its value. In a retail title, a packedR32_UINTlighting target heldf16(asfloat(bits))(0x7BFFwhere the packed value was large) instead of its bits; on screen that showed as a blue-white glow on skin and lit surfaces. This applies the table: every target gets the 32_ABGR variant, so the channels leave the shader unconverted and the PC target converts them. Part of #505.How this relates to #3200 (merged 2026-11-29, after this PR was opened; it fixes the same symptom)
rt32_maskfrom the PSO), when its liveness check allows it (it declines when an aliased conversion destination stays live after theexpor reaches a branch or join).main(now0fe06eb0) joins the two cache-name changes: a pixel shader's translated-cache file name carries this PR's export mode and Recompiler: patch console FP16 PS exports for 32-bit render targets #3200's_rt32_<mask>(in that order, so Recompiler: patch console FP16 PS exports for 32-bit render targets #3200's test is unchanged).What is in it (one commit)
crates/xcl/src/gpu/xbox.rs:patch_ps_exports, called fromanalyze_fssmfor FSSMs whose code region comes from the header (version 0x101). Per render target it copies the 32_ABGR variant over the stored export code. A table that is implausible (no PS record, a patch size of 0 or over ten dwords, a patch past the end of the code, an empty variant) changes nothing.XCL_PS_EXPORT_PATCH=0keeps the stored exports. Two tests: the patch lands on the right dwords and nothing around them changes; each kind of implausible table leaves the buffer byte for byte the same.crates/xcl/src/gpu/recomp/pso.rs: a pixel shader's entry in the translated-shader cache names its export mode (translated::exports_mode), so a warm cache does not hand one mode's translation to the other; older unlabelled pixel entries are not read. Found and fixed by @andrewDoing in review; the cache-name test asserts it.README.md: one note on the patches and the switch.THIRD_PARTY.md: the table layout (record at payload + 0x30, stage data at record + 0x54, size at + 0x148, eight entries from + 0x14C, ten variants of ten dwords) is as VIctory documents it invictory-shader/src/native.rs(GPL-3.0). The code here is written independently; VIctory's row says so.gpu/xbox.rsis one of the translator's sources, so the translation cache identity changes with this PR.Tested
bb0679fbonmain3b6a91ed. The head is now710a5f4f, the same commit rebased ontomain0fe06eb0to pick upmain's test fixes:main's geometry tests failed CI at3b6a91edand were fixed in468190c2, and CI on601481ed(onbc2cbb72) failed in the fourpipeline_library/warm_librarytests of CI: tests that fail by timing or shared state keep unrelated PRs red (5 sightings on 28 Nov) #3180, which Tests: serialise the pipeline tests that store into the library builder #3221 (2c003dd6) fixes. On710a5f4f,cargo test -p xcl --lib -- recomp::pso xbox:: rt32 ps_32bit_rt_export pipeline_library warm_library pipeline_cap_tests --test-threads=4: 72 passed, 0 failed, 1 ignored, no SKIPPED. RTX 4070 SUPER 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB RAM, Windows 10 19045, Rust 1.100.0; tests in debug, the title in release; all runs with a cache directory of their own (XCL_DXIL_CACHE).cargo test -p xcl --lib -- recomp::pso xbox:: rt32 ps_32bit_rt_export: 57 passed, 0 failed, 1 ignored (this PR's tests and Recompiler: patch console FP16 PS exports for 32-bit render targets #3200's).cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: the integration harnesses 138 passed, 1 failed, 20 ignored. The failure,e2e::test_title_runs_and_game_folder_is_untouched("a texture in title memory (XG layout, Split wave32 geometry: refuse prefix counts over a mask #44) follows CPU writes: subresource 2 row 0 differs"), passed 2 of 2 runs on its own on both this head andmain3b6a91ed. The library harness ended early, with exit code0x80004005after "sparse upload preparation still failed after bounded retries – the title is stopped before its GPU submission" (prepare_title_submission→end_title), as it does onmain(reported before on this PR).--test-threads=1) in parts, on this head and onmain3b6a91ed:list_x::tests: 104 passed, 0 failed on both;sparse::tests: 140 passed, 0 failed, 1 ignored on both. (A full single-threaded run ended with the abort above inside these groups, atsparse::tests::a_buffer_over_a_remapped_tile_reads_the_new_page, which passes on its own on both.)--skip list_x::tests --skip sparse::tests): on both, the run ended with the same abort at the same test,texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays. Up to there: this PR 1,585 passed, 4 failed;main1,583 passed and the same 4 failed (the 2 more are this PR's tests). The 4 aremain's own geometry tests:geometry_tests::gpu_geometry_msg_gs_done_records,geometry_tests::msg_gs_done_emits_in_dxil,lower_geom::tests::gpu_epilogue_filters_oob_triangles_and_no_store_emits,lower_mem::stage_guard_tests::geometry_export_rejected.e8782653onmain10d27297) the whole library ran single-threaded: 2,012 passed, 7 failed, 28 ignored, againstmain's 2,010 / 7 / 28, the failuresmain's own.SKIPPEDon this adapter, 26 lines, the same on both: 22 "no wave64", 3 per-lane f16 refusals ("its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's"), 1 "no heap windows (opt-in: XCL_HEAP_WINDOWS=1)". None is a test of this PR.Regression run
scripts/smoke.ps1, 200 s, the same title, no input,XCL_PREPARE=0on both (both build in game what they use), each run with its tree's ownscripts/smoke.ps1and with a cache directory of its own.main:
this PR's head:
Not tested
UINT16/SINT16formats): not by me; @andrewDoing checked them on an RTX 5070 in review (in-range values preserved on both shader paths).AI use
🤖 Generated with Claude Code