Repository navigation
Conversation
|
A data point from an RTX 5070 Ti (driver 621.40), retail title, Series X profile: with
Both happen on a title thread right after it creates a two-pass argument scratch buffer. Without the switch, 0 of 1 on the same binary: that run reaches the world. The feature itself works here:
Tree:
The same Not tested: driver 621.24 or earlier, other NVIDIA generations, this PR without the rest of the stack. AI use: Claude Code with Claude Opus 5.5 ran the runs and wrote this. AI-assisted. |
|
@claudetools-gh thanks, this is very useful, and the first crash looks familiar: So my reading is that the cast list is not the cause but shifts the timing at world entry enough to hit the race more often. It is a reading, not proof: could you run the same binary with #3317 ( AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash. |
|
Follow-up to the crash report above: it was #3317's race, not this change. claudetools-gh reran the same tree with #3317 added and AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
Stacked on #3281: the two XCL_PAIR_PAGES commits under it are #3281's, so only the top commit ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
…s pages A title can place two descriptions at one address: a 1280x720 R32_UINT UAV and a 1280x720 R9G9B9E5 SRV. XG sizes them 0x384000 (57 pages) and 0x3c0000 (60 pages), so the one placed second owns 3 pages more than the first, and those are the shared pages of the texture the title put 0x390000 after them. The sampled alias then reads that neighbour's memory (a step in the captured frame), and placements sees it Around the target and supersedes it. With XCL_PAIR_PAGES=1 (off by default) place_on_pages caps a texture placed at the address and tile count of a live mapped one to the smaller of the two (pair_bytes) and keeps the capped size in its Target, so the later texture shares exactly the written partner's pages and its other tiles are private (va, i) tiles. Placed first, the larger texture is not changed (its tiles are bound already). The cap is made before the range is handed to placements, so a capped pair is Same, not Around. The log line is printed for the first two and powers of two. The cap is not the byte layout of the console. Measured with the GDK's XG library: the two layouts (0x102 and 2) put texel (x, y) at different offsets (first difference at (8,0); 920896 of 921600 texels differ), and the SRV's 3-page overrun is real on the console (36864 texels past the UAV's end). The cap is what the PC alias shows. Tests: pair_bytes on targets (two) and a GPU test with the real descriptions and a neighbour at +0x390000 (80 of 128 neighbour rows are overwritten without the cap), each failing with pair_bytes returning its own size; a placements test that the capped pair is Same. Assisted-by: Claude Code (Claude Sonnet 5.5)
The title places an R9G9B9E5 view by address over a live R32_UINT texture (1280x720, 0x384000 bytes). XG sizes the view 0x3c0000 and the title's next resource starts at the view's address + 0x384000. Table::insert saw that resource inside the view's range, called the view superseded by a different range, and vram::unmap_superseded mapped all 60 of its tiles to NULL: the compute pass that read the view got zeros and wrote zeros over the R32_UINT. XCL_PAIR_PAGES=1 capped only the vram extent (pair_bytes), not the table's. On main this reaches GPU-owned entries too (register_gpu_owned), whose range a different-range placed entry unmaps. The entry now keeps the capped extent (vram::pair_capped_bytes reads it from the placed Target, so pair_bytes stays the one place that computes it) and insert, retire_range, remove, the source links and the hot range use it, and so does the retire_overlapping fallback of CreatePlacedResourceX when register_gpu_owned fails (vram::owned_extent), which retired the full console size. Only under XCL_PAIR_PAGES=1. Tests: gpu_register_takes_the_cap_from_the_pair (register's range stops at the capped extent, owned_extent gives the capped size; skip_test without reserved textures; the fallback itself needs a failing register_gpu_owned on a device, so it is covered through owned_extent); capped_placed_view_is_not_superseded_by_its_neighbour fails with the cap ignored (the insert at address + 0x384000 returns the view to unmap). Assisted-by: Claude Code (Claude Sonnet 5.5)
…9B9E5 one texture The retail title packs light as R9G9B9E5 into R32_UINT textures its compute programs write, and samples the same memory through an R9G9B9E5 texture it places at the same address. On the console that is one memory; here the sampled texture is a PC texture of its own that nothing writes. With XCL_CAST_LIST=1, where the device has relaxed format casting (OPTIONS12), ID3D12Device10 and samples R9G9B9E5, a GPU-written R32_UINT 2D texture on the title's pages is made with CreateReservedResource2 and [R32_UINT, R9G9B9E5_SHAREDEXP] as its cast list (a texture the title gives a cast list of its own, device xcl-dev#127, with that list). A view the title makes of a texture at the same address, of the same shape, in another format of the list, is made on the written texture. Its read-only legacy states (not COMMON) also take the shader-resource states the list type has (DIRECT both, COMPUTE the non-pixel one, COPY none), on both sides of every transition. The views go with the written texture (console_heap::resource_gone); a recycled sampled texture is forgotten before it is parked. It is made only in the initial states whose layout is the same state (COMMON, RENDER_TARGET, UNORDERED_ACCESS, COPY_DEST); a refused create is made as before. Off by default. Tests: the matching and the state widening (cast_list), and a GPU test of the route itself in a child process with the debug layer on: one texture written as R32_UINT through a UAV and read through an R9G9B9E5 SRV, committed and reserved (tiles mapped on a second queue), every texel compared with a CPU decode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Follow-up review (head 8a2d751, since b25dbd8, diff read, not a merge-check; checks red):
New:
Fine: with AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
Cache positive and negative R9G9B9E5 volume support queries per device, and only ask for that support after the format/UAV eligibility checks. Add focused tests for cache behavior and query gating. Checked: xcl-dev#3491, xcl-dev#3340.
Stacked on #3281 (Pipodi:
XCL_PAIR_PAGES=1; its two commits are underneath, rebased onto main6bfb5c51; only the top commit belongs here).The retail title packs light as R9G9B9E5 into R32_UINT textures its compute programs write (they cannot store R9G9B9E5), and samples the same memory through an R9G9B9E5 texture it places at the same address: its sky, its light probes, the bounced light its lighting pass adds. On the console the two are one memory. Here they are two PC textures, and nothing writes the sampled one, so what is read through it is stale.
This makes them one PC texture, by relaxed format casting. With
XCL_CAST_LIST=1, where the device has relaxed format casting (OPTIONS12), ID3D12Device10 and samples R9G9B9E5, the written texture is made with both formats in its cast list. The title's views of the sampled texture are then made on the written one. It works on any vendor that answers those three checks, and does nothing where one is missing. #3281's page cap is needed underneath, because XG sizes the R9G9B9E5 view larger than the target it describes (0x3c0000 against 0x384000 at 1280x720).Off by default: it changes what the title reads.
Related: #3094 (the copy route for the same pair), #3282 (unaligned pair-page support), #3317 (needed with it on NVIDIA: see Not tested), #1833.
What is in it (one commit)
hle/d3d12x/cast_list.rs(new):for_writergives the cast list a GPU-owned texture is made with: a 2D R32_UINT UAV texture gets [R32_UINT, R9G9B9E5_SHAREDEXP]. A texture the title gives a cast list of its own (console device Runtime: CPU check at start, bounded reads in the exception logger, t… #127) gets that list. A cast list of fewer than two formats is none.view_on_writermatches a view of a texture at the same address, of the same shape, in another format of the list, to the written texture.read_statesends the written texture's read-only legacy states as COMMON, in which every list type reads it through any of its views. The texture has a barrier layout (the cast list needs one at creation), so the debug layer follows it by layout: a legacy read state would put it in a GENERIC_READ layout, which a later submission that reads it with no barrier does not expect (debug layer error 1334, 8 times in the title on the 5090).hle/d3d12x/vram.rsplace_on_pages: the written texture is made with CreateReservedResource2 (real::dev_create_reserved_resource2, adopted like the other creates) in layout COMMON, the one layout legacy barriers work with (made in UNORDERED_ACCESS it is debug layer error 1350, and the 5090 hung after it). Right after its tiles are mapped,Pages::settlemoves it to the title's initial state with one legacy barrier on XCL's tile-mapping queue, whose fence every title queue waits for before its work, so the title finds it where it made it, also when it writes it with no barrier first. A refused create is made as before.hle/d3d12x/real.rs:dev_create_srv_innermakes the matched view on the written texture before the slot is published. The slot is noted as the written texture's, so its views go with it (console_heap::resource_gone).res_releaseforgets a texture beforepark_recyclablehands its object out again.hle/d3d12x/list_x.rsresource_barrier_x: both sides of a transition of a written texture go throughread_state, before the no-op check and the state tracking, so every list agrees on its state. The title's Compute dispatches: a shader takes no more arguments from user SGPRs than it has (XboxBvhBuilder builds empty BLAS / TLAS) #146 barrier groups reach it too (main'sbarrier_groupssends them throughresource_barrier_x).hle/d3d12x/device_x.rs: the title's placed textures are noted (note_created) where they are registered.cast_list: the matching (address, shape, format in the list, a recycled texture resolved again) and the read states.gpu/recomp/runner/cast_tests.rs(new): the route itself on a real device, in a child process with the debug layer on. One texture is written as R32_UINT through a UAV and read through an R9G9B9E5 SRV, committed (CreateCommittedResource3) and reserved (CreateReservedResource2, 64KB_UNDEFINED_SWIZZLE, tiles mapped on a second queue). The texture is made in COMMON and moved to UNORDERED_ACCESS on the second queue asvramdoes, the title's first list writes it with no barrier, its transitions go throughread_state, and two later submissions read it with no barrier (the first also writes it again). Every texel is compared with a CPU decode after each submission.Tested
8a2d7518on main6bfb5c51: conflicts inplacements.rswere resolved by retaining both main's placement tests and the capped-pair test;real.rsretains bothbarrier_groups::forgetandcast_list::forget. Cast-list behavior remains off unlessXCL_CAST_LIST=1.cargo +stable-x86_64-pc-windows-msvc build --workspacesucceeded. WithXCL_NETWORK=0,cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib cast_list -- --test-threads=1passed 4 tests (including the GPU cast-list test, 0 skipped);cargo +stable-x86_64-pc-windows-msvc test -p xcl --lib hle::d3d12x::vram::tests -- --test-threads=1passed 75, failed 0, ignored 1.8a2d7518.cargo test -p xcl --lib -- cast_tests --nocapture --test-threads=1, at 6ddb2908 (this commit plus a local test-only switch,XCL_TEST_CAST_WIDEN=1, that runs the same test the way the previous head made the texture: in the UNORDERED_ACCESS layout, no move on the second queue, read states widened).cargo test -p xcl --lib --no-run, debug and release: both build.cargo test -p xcl --lib -- cast --nocapture --test-threads=1: 4 passed, 0 failed, 0 ignored, 2689 filtered out. The route test on this RTX 3090 (no debug layer): both routes bit-exact, no device removal.cargo test --workspace --no-fail-fast -- --test-threads=4: the lib binary was killed (STATUS_ACCESS_VIOLATION) in the 4-thread run, whilegpu::agility::tests::create_device_sets_dred_first,gpu::bvh::tests::scene_trace_matches_brute_forceandgpu::dxil::compact_tests::a_large_program_that_repeats_itself_takes_the_compact_formran. That is main's own: mainfa204595was killed the same way on this machine with the same three running (main53e85fb1's own run of the suite here happened to finish). Rerun on 1 thread: 2651 passed, 5 failed, 29 ignored; e2e 4 passed, 1 failed; gpu_compute_e2e 9 passed, 0 failed.53e85fb1on this machine (2646 passed, 5 failed, 29 ignored):title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, the 3stream_recheck_*tests,standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline(main's test does not count the stand-in pipeline's deferred release, Related: Tests: account for deferred stand-in pipeline release #3484), and e2etest_title_runs_and_game_folder_is_untouched.Regression run
RTX 5090 32 GB, driver 621.40, the retail title, 600 s each,
scripts/smoke.ps1with preparation off (XCL_PREPARE=0), each run starting from its own copy of the same translated cache (made bymain). Both runs used this machine's usual settings (XCL_UMA_WINDOWS=16,XCL_UMA_DRIVER=mixed:1536:1792,XCL_COHERENT_MB=4095,XCL_HUGE_PSO_CONCURRENCY=3) and leftXCL_CAST_LISTunset (off, as by default), so this pair shows the default path unchanged.Neither run reached the world in its 600 s (shader compiles ran to the end): the pair shows boot and loading with no device removal and a peak commit at 101.6 % of
main's; its frame counts are presents of the title's first screens and say nothing about speed.main9dfbe3e:this head
b25dbd80:Not tested
XCL_CAST_LIST=1instead of the alias copy ran without a crash, and the cast list filled the light probes (the window's sky and yard lit, 1.09 presents/s against 1.02 with the copy; 1 of 1, Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505 (comment)). So this change needs D3D12.X: keep the first indirect scaling pipeline per device #3317 underneath on NVIDIA in practice.read_stateis from the debug layer's message in the title (a GENERIC_READ layout where COMMON is expected at the start of a submission), not from a run that shows it gone. The title with the switch on and the debug layer has not been run at this head yet.AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR