Repository navigation
Conversation
|
Review (head 5e4becf, diff read, not a merge-check; draft, stacked on #3340 -> #3281, so this covers 5e4becf):
Fine: this commit is about 186 lines and does nothing without AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Stacked on #3340 (and #3281 under it); its own commit only extends 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 sampled texture placed at the address and tile count of a live mapped texture the GPU writes, and that it is a view of, 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. Only a written texture is a partner (pair_partners), and only while it is the current placement: mapped, held by the title and not superseded in placements (placements::current_view; a superseded target stays mapped in vram until its deferred unmap, late_release::hold_unmap), to a sampled texture with the same size and levels and a texel of the same size (Desc::same_texels, the rule placements keeps the two on one memory by; a texture of another shape with as many tiles is something else the title put in that memory, and keeps its size), with the size CreatePlacedResourceX passes (console_bytes: XG's, or for a 3-D texture XG cannot lay out the bytes of its texels; not the least_texture_bytes lower bound). A sampled texture caps nothing, capped or not. A texture the GPU writes is never capped: on the console it has all of its own size, and its readback into the title's memory (title_textures::publish_download) goes by its whole layout. The registry is asked with PAGES released: its lock is the outer one of the two (placements::unmap_if_superseded). 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 (a written partner; a sampled one or one of unknown size caps nothing and a written texture is not capped; a superseded partner before and after its unmap), placements::current and current_view on a registry (another shape, other levels and another texel size are not a view), a placements test that the capped pair is Same, and GPU tests with the real descriptions: a neighbour at +0x390000 (80 of 128 neighbour rows are overwritten without the cap, with pair_bytes returning its own size), and a written texture made after a smaller sampled one and then superseded (with every mapped texture a partner it is capped to 0x384000; with the registry not asked, the sampled texture made after it is capped to the superseded one; a sampled 720x1280 texture at the address of a written 1280x720 one has as many tiles and keeps its size). Assisted-by: Claude Code (Claude Sonnet 5.5) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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. The entry of a sampled texture 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. So do the test for written pages (Entry::written_in), the pages a partial upload compares (dirty_on) and the fingerprint of a view whose memory is not watched: a write to the neighbour's first bytes is in a 1 MiB source piece of the view, and with the view's whole size it sent the view up again. Every upload of a capped view, its first whole one too, now stops at its cap (texture_upload::Item::own_tiles from vram::pair_capped_tiles, the tiles owned_pages gives it; texture_upload::owned_parts clips each piece to them). The view's tiles past the cap are the extra pages keyed (va, 57..59) it shares with the R32_UINT, whose last texels they hold: a whole upload of the view wrote the neighbour's bytes over them, and the view's first upload after register is always a whole one (pending; gpu_written is only set on the writer's entry). A level in the packed mips or a 3D level goes up whole when the view owns all of its tiles, else not at all. Each array slice has its own packed mips, D3D12_PACKED_MIP_INFO's start (slice 0's) plus the slice times the tiles of a slice, and a level from NumStandardMips on is packed: WARP gives the packed subresources of slice 1 slice 0's start and no tiles, not D3D12_PACKED_TILE (256x256, 2 slices, 9 mips: start 5, 0x0). The hashes of its pages are still those of the whole layout. The entry of a texture the GPU writes (register_gpu_owned) has no cap: vram never caps one, and publish_download writes its whole layout back into the title's memory, so its range in the table is its whole size. Only under XCL_PAIR_PAGES=1. Tests: gpu_register_takes_the_cap_from_the_pair (register's range stops at the capped extent, the written texture keeps its own size; skip_test without reserved textures); capped_placed_view_is_not_superseded_by_its_neighbour fails with the cap ignored (the insert at address + 0x384000 returns the view to unmap), and with the whole size in written_in (a written page at address + 0x384000 selects the view); a_capped_views_fingerprint_ends_at_its_cap fails with the whole size fingerprinted, in the baseline (seed_stream_recheck) or in the recheck (a write past the cap, in the end slice of a whole-size fingerprint, queues the view); gpu_a_capped_views_first_upload_leaves_the_tiles_past_its_cap places the pair on pages, registers the view, sends its first upload through upload_all and fails with the clip off or with no own_tiles from upload_all (the view writes 30720 texels of tiles 57..59 of the R32_UINT); gpu_a_capped_arrays_first_upload_stops_at_its_cap_in_a_later_slice caps a 2-slice array with packed mips one tile into slice 1 and fails with slice 0's packed start for every slice, with the packed levels taken from D3D12_PACKED_TILE alone, or with no own_tiles from upload_all (slice 1's packed mips get the view's bytes). Assisted-by: Claude Code (Claude Sonnet 5.5) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
The title packs bounced light into a 128x128x8 R32_UINT texture and samples it as R9G9B9E5 at the same address, as it does its 2D light textures (xcl-dev#505: with XCL_ALIAS_COPY=1 the character the room lights is lit; with the cast list it stayed black, because only 2D writers got a cast list). A GPU-written R32_UINT volume (TEXTURE3D) now gets [R32_UINT, R9G9B9E5_SHAREDEXP] as well where the device supports both TEXTURE3D and SHADER_SAMPLE for R9G9B9E5; a reader volume at its address, of its shape, gets a whole-volume view on it. A 2D array of the same size is another shape and is not matched. Reserved resources use the corresponding legal initial layout (COMMON, RENDER_TARGET, UNORDERED_ACCESS, or COPY_DEST); tile mapping remains on the existing mapping path. A refused create is made as before. Tests: cast_list's matching for a volume and a 2D array at its address; the GPU route test also runs a 128x128x8 volume, committed and reserved, written as R32_UINT through a 3D UAV and read through an R9G9B9E5 3D SRV, every texel compared with a CPU decode, the debug layer on where it is (a device that cannot sample R9G9B9E5 volumes, or has no tier 3 for a reserved one, says so and skips that route). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5e4becf to
f55b469
Compare
|
Follow-up review (head f55b469, since 5e4becf, diff read, not a merge-check; draft, checks red):
New:
Fine: the own commit is about 250 lines and changes nothing without 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.
|
@Foniass thanks for the follow-up. Fixed on Tested (RTX 3090 VM, driver 621.24, The five suite failures are the same as main on this VM: AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
Follow-up review (head 7675615, since f55b469, diff read, not a merge-check; draft, checks red):
New:
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
Preserve the title's resource states, honor zero-mip full-chain views, and bind its cast list to the allocation being created. Exercise repeated reads and writes in the 2D route test. Checked: xcl-dev#3340 review 6143106973; xcl-dev#3491 follow-up 7331505470.
Preserve the title's resource states, honor zero-mip full-chain views, and bind its cast list to the allocation being created. Exercise repeated reads and writes in the 2D route test. Checked: xcl-dev#3340 review 6143106973; xcl-dev#3491 follow-up 7331505470.
Stacked on #3340 (and #3281 under it); the two top commits belong here.
The title packs bounced light into a 128x128x8 R32_UINT volume its compute programs write, and samples it as R9G9B9E5 at the same address, as it does its 2D light textures. #3340 gives only 2D writers a cast list, so this volume stays on the stale side: with
XCL_CAST_LIST=1the character the room lights stays black, where the copy route (#3094, which covers that pair) lights it (#505, 7266197025).This gives R32_UINT volumes the cast list too, where the device samples R9G9B9E5 volumes. Off by default, as #3340 (
XCL_CAST_LIST=1).Related: #505, #3094.
What is in it (two commits)
hle/d3d12x/cast_list.rs:for_writergives a TEXTURE3D R32_UINT UAV writer [R32_UINT, R9G9B9E5_SHAREDEXP] where the device samples R9G9B9E5 volumes (FORMAT_SUPPORT1_TEXTURE3DandFORMAT_SUPPORT1_SHADER_SAMPLE, queried only after the R32_UINT/UAV checks and cached by adapter LUID, including unsupported results).keep_readerkeeps 3D readers;whole_viewmakes a TEXTURE3D view. A 2D array of the same size is another shape and is not matched. Reserved writers are created in the title's initial layout, while page mappings use the existing mapping path; a refused create (reserved volumes require tiled resources tier 3) falls back to the original resource path.cast_list: a volume reader at a volume writer's address gets a whole-volume view on it; a 2D array of the same size is not matched.samples_volumesquery gating and adapter-cache behavior are covered byvolume_support_is_only_queried_for_r32_uav_volume_writersandvolume_format_support_is_queried_once_per_device_including_failure.gpu/recomp/runner/cast_tests.rs: the GPU route test also runs a 128x128x8 volume, committed and reserved, written as R32_UINT through a 3D UAV and read through an R9G9B9E5 3D SRV, every texel compared with a CPU decode. A device that cannot make such a texture says so and skips that route.cast_list.rs, 209 in the GPU route test.Tested
76756152ba5fbe6d1783563cf76ffe3c2e59e201, based on main1c8b551475e1e7bfe48f94448492a4c3544a2e0f, with current D3D12.X: XCL_PAIR_PAGES=1 caps a texture in a live one's memory to its pages #3281 and D3D12.X: XCL_CAST_LIST=1 shares one texture between R32_UINT and R9G9B9E5 #3340 commits beneath D3D12.X: XCL_CAST_LIST=1 gives R32_UINT volumes the cast list too #3491.76756152, RTX 3090 VM, driver 621.24,XCL_NETWORK=0:cargo test -p xcl --lib -- volume_support --nocapture --test-threads=1passed 1/1;cargo test --workspace --no-fail-fast -- --test-threads=4(with the runner's threeuma_driverskips) reported 2,922 passed, 5 failed, 51 ignored; the lib binary completed without a crash. The five failures also fail on main1c8b5514(main 2,901/5/51):placed_title_textures_share_vram_and_preserve_pixels, the threestream_recheck_*tests, andtest_title_runs_and_game_folder_is_untouched. The 28 capability skips were 22 no wave64, 2 no heap windows, and 4 no debug layer.f55b4698, the focused R32_UINT/R9G9B9E5 route test passed 1/1 andcast_testspassed 2/2 on the same VM.5e4becfb(before this rebase):cast_tests2/2; 2D and 128x128x8 volume routes were bit-exact for committed and reserved resources, with no debug-layer errors or device removal.5e4becfb, not this rebased head. No retail-title smoke has run on76756152; the blocks below are from5e4becfb.Regression run
The smoke blocks below are from prior head
5e4becfb, before the rebase. Both runs leftXCL_CAST_LISTunset; no retail-title smoke has run on final head76756152.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 104.0 % of
main's; its frame counts are presents of the title's first screens and say nothing about speed.main9dfbe3e:this head
5e4becfb:Not tested
XCL_CAST_LIST=1: whether the character is lit with this (not run yet).AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR