d1dfbbd4dcd0b8091c9ad12cc3b1e7be708537a8
624
Commits
-
xmem: keep the space below 4 GiB for the title's 32-bit memory (#1009)
* xmem: keep the space below 4 GiB for the title's 32-bit memory XMemVirtualAlloc with the 32-bit address flag has to fit below 4 GiB, where Windows also puts the host's own memory first (it allocates bottom up). With a large pipeline cache read at startup, the driver's, heap and cache memory left 22 MB there, in pieces of at most 14 MB, when Grand Theft Auto VI asked for a 185 MB 32-bit placeholder; the request was refused (ERROR_NOT_ENOUGH_MEMORY) and the title stopped at an assertion (+0x19f4f58). The D3D12 debug layer's memory did the same. `low_guards::install`, at the start of `run`, reserves the free space below 4 GiB but the lowest 256 MB (left to the host). A 32-bit request that finds no room releases the smallest guard that fits it (else the largest) and tries again, then guards what is still free of it. Tested: the new test releases a guard, takes part of the hole and checks the rest is guarded again. In the title (RTX 2080, a build with a large cache): without this the startup failed 2 of 3 times; with it, 5 of 5 starts passed, 3.7 GB below 4 GiB kept for the title. * Bound low-address allocation retries to existing guards * xmem: safety comments and formatting for the bounded guard retry --------- Co-authored-by: swarm <swarm@swarm.swarm> Co-authored-by: NuraadGit <NuraadGit@users.noreply.github.com>
-
GPU: a full early pipeline list drops the oldest runs' keys (#983)
The early list keeps this run's keys first, then earlier runs' others, but those came from a HashSet, so once the list was full the keys that made room were any earlier ones, not the oldest. Earlier keys now keep their place in the list as loaded. The list is saved most recent run first, so sorting by that place drops the oldest runs' keys and keeps the order across saves. A list saved by an earlier build (in no order) still reads. `save` also reads the list through `used()`, so a save before anything read it in this run keeps the saved list instead of writing an empty one.
Danilo Mori Schuler
2026-11-25 22:49:30 +01:00 -
Shaders: v_mul_legacy_f32 treats denormal operands as zero (#682)
RDNA2 flushes denormal operands of the legacy multiplies to zero, so 0 x anything = 0 also holds for them. The lowering only tested for an exact float zero, whose result also depends on the host's denormal mode. Test the exponent bits instead. Follow-up to #2.
Senchsus
2026-11-25 22:49:23 +01:00 -
CLI: reject zero shader translation workers (#506)
- Reject --jobs 0 in both translation modes before starting workers. - Cover the CLI exit and diagnostic without including title files.
Yusuf Al-Khawaldeh
2026-11-25 22:49:16 +01:00 -
GPU: mirror placed unordered texture views (#1273)
* GPU: mirror placed unordered texture views (#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>

Fuzeofficialandandrewpozdnakov7-jpg
2026-11-25 22:40:05 +01:00 -
QB
2026-11-25 22:39:36 +01:00 -
Shaders: share and serialize WARP host operations across threads (#244)
Fixes #181. Concurrent WARP (d3d10warp.dll) usage across threads crashes with 0xC0000005 on Windows 11, both when creating/tearing down separate WARP devices and when compiling pipelines or executing work concurrently on a single shared WARP device. Keep one process-wide WARP ID3D12Device in Host::new (for explicit warp = true, VICTORY_WARP=1, and systems whose default DXGI adapter has DXGI_ADAPTER_FLAG_SOFTWARE) and serialize WARP root signature creation, pipeline compilation, draws, and dispatches behind a process-wide mutex. Hardware D3D12 devices remain unserialized. Route diff_tests's direct CreateRootSignature calls through Host::root_signature_bytes so they share the same serialization, and add a multi-threaded WARP regression test (parallel_warp_pipelines_and_draws). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Manuel PérezandClaude Opus 5.5
2026-11-25 22:37:48 +01:00 -
Shaders: reuse SSA sums when tracing memory addresses (#139)
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
-
XAsync: run a failed call's cleanup without the completion lock (#114)
XAsyncComplete held the call's `done` lock while the title's provider ran OP_CLEANUP. A cleanup that waits for a worker thread which is itself completing the same call (it took the call before the cleanup removed it) deadlocked: the worker blocks on `done`. The first completion now claims the call with an atomic flag and runs unlocked; the status is still published after the cleanup, while the block is valid, and `done` is set only for the waiters. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Manuel PérezandClaude Opus 5.5
2026-11-25 22:35:28 +01:00 -
README: status of 2026-11-25, the prologue is reached at about 1 fps
The title now plays the intro cutscene and reaches the prologue with the graphics fully displayed. Splits the two in the stage table, updates the subsystem rows, the memory requirements and the pipeline pre-build timing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

MarvisandClaude Sonnet 5.5
2026-11-25 17:51:02 +01:00 -
Shader tests: the compute harness zeroes its UAVs
A new committed resource is not always zeroed: on the CI's WARP the 512 KiB mark buffer of heap_direct_texture_reads_mark_their_heap_index came back holding the page table an earlier test had uploaded and freed, so the test saw 16,389 bits besides the one the shader set. Buffers, root UAVs and UAV textures are now made as copy destinations and get zeros from an upload buffer before the dispatch. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

MarvisandClaude Fable 5.2
2026-11-25 16:46:21 +01:00 -
Shader: normalized buffer codes convert to the float nearest their quotient
What was wrong: buffer and typed-buffer loads of normalized formats (UNORM, SNORM) converted a code by dividing it on the host. The host's division is not exact. On the RX 6700 XT, 125 of the 256 8-bit codes loaded one ulp high, and 16-bit codes such as 257, 261, ..., 32896 loaded one ulp low; WARP was exact. The console's buffer unit gives the float nearest the exact quotient, and titles rely on it in decisions: Grand Theft Auto VI's mesh programs read a material index from a vertex colour's alpha as `v_mul_legacy_f32 255.0` then `v_cvt_u32_f32`. A quotient one ulp low truncates to the code below (the 16-bit codes above did), so another material is picked. What changed: for formats up to 16 bits per channel the quotient a / (2^n - 1) is worked out from integers: Q = floor(a * 2^32 / d) as a * K plus a correction (none when n divides 32), rounded to 24 bits up exactly when its highest dropped bit is set (the quotient is never exact, so never a tie), and that integer, at most 2^24 and so exact as a float on any host, scaled by a power of two. The reference is the exact quotient rounded to the nearest float, which removes the dependence on how the host rounds a division or converts a large integer (WARP rounds integers above 2^31 otherwise). Signed formats convert their magnitude the same way; their two lowest codes stay -1.0. The 11- and 12-bit widths, whose smallest codes need more bits, are rounded fully in integers. Cost: about 18-21 DXIL operations a channel where the division was 2 (a division by a constant more where n does not divide 32), so a 4-channel 8-bit fetch is about 80 operations instead of about 12. The car body's mesh program grows from 4,616 to 5,103 instructions (+487 for about 23 normalized channels). In the title it is not measurable: in a run of the intro cutscene with this commit (cost2, on the previous main
4015a182), on world windows with no pipelines being made, the frame median was 881 ms and the GPU 349 ms a frame (median 335), against 1,013 and 389 (365) for the same tree without it (s1a). Two runs of one tree have differed by 132 ms of GPU a frame, so the difference is within run-to-run noise. Evidence: tests `normalized_buffer_formats_load_correctly_rounded_quotients` (every 8- and 10-bit code and a 16-bit sample, unsigned and signed, bit-exact on hardware and WARP; it failed on the RX 6700 XT before, at 8-bit code 3) and `normalized_codes_truncate_back_to_themselves` (the title's truncation gives every code back; 16-bit code 257 came back as 256 before). Offline, the integer arithmetic as emitted matches the exact quotient for every code of every width 2 to 16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 15:50:41 +01:00 -
Shaders: descriptors joined by nested control flow, again
Brings back PR #1012's recursive heap index (taken back by
fbac5bb6): a descriptor every lane shares, chosen by an if/else nested in another, reaches the outer join with an edge that is itself a join; its heap index is a phi at each join of what each predecessor computes at its end. It lets `indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays` (39f0e9aeb156a61c, issued every cutscene frame) through, whose host pipeline the AMD driver could not make before the two commits ahead of this one. The program itself is large: 74,700 GFX10 instructions, 11,896 branches (488 backward), 1,889 typed buffer loads, each after a reload of the same descriptor. Its DXIL, and what the AMD driver (RX 6700 XT, 32.0.21045) does with it: | | #1012 alone | now | |---|---|---| | lines (dxc -dumpbin) | 151,610 | 24,896 | | branches (conditional) | 22,382 (10,040) | 3,070 (1,295) | | blocks | 22,384 | 3,072 | | heap handles | 2,608 | 65 | | size queries | 2,477 | 0 | | phis | 2,883 | 1,124 | | DXIL bytes | 864 K | 144 K | | validator | passes | passes | | host pipeline | over 6 GB at 64 s, never finished (26.7 GB unwatched) | 2.36-2.45 GB, 78-107 s (with other work on the machine) | What remains costly is the program's shape: one loop of 2,941 blocks holding 1,239 of its 1,295 conditional branches, an inner one of 1,440 (the largest loop of the largest program by DXIL bytes, RTShadowTrace32TemporalHQ_OneOver4RPP_Tiled, has 110 blocks; it compiles in 14 s, 353 MB). Making every branch uniform (an experiment) took the compile to 1.9 GB and 54 s, so divergence is not most of it. The pipeline library keeps it after the first make. WARP refuses the pipeline at once (E_INVALIDARG): the program declares the console's wave size (32), which WARP's 4-lane waves cannot run, as for every compute program that declares one. Whole list, translate --list --validate: 0 newly failing, 1 newly emitted and validated (this program). Test: the nested-join lowering test is back (`descriptors_joined_by_nested_control_flow_lower_to_one_uniform_handle`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 15:45:57 +01:00 -
GPU: barriers start from the states resources are in: prelude order, the clamp's own buffer
The debug layer reported ~16 resource-state errors a second in the world on main (run light21) and with the queue order (light19), four kinds: Depth twins, and 16-bit depth textures with twins (COPY_SOURCE, UNORDERED_ ACCESS and COMMON against DEPTH_WRITE): a list's prelude swapped each texture's real state for the one the list leaves before recording the twin copies it owed, so those copies moved the textures from the wrong states. The prelude now records the copies from the real states, then the list's moves from them, and only then stores the states the list leaves. The title's 174 MB GPU heap, bound as a vertex buffer while in UNORDERED_ ACCESS, and barriers on it disagreeing with the state an earlier vertex binding promoted it to: our only transitions on a title buffer's copy were the indirect clamp's, UAV to INDIRECT_ARGUMENT and back to UAV. The clamp now reads the title's records through a root view and writes the clamped ones into an argument buffer of the list's own, which the execution reads; only that buffer is transitioned (common, unordered access, indirect argument, common). Title buffers' copies are never transitioned: common between submissions, promoted by every use, ordered by unordered-access barriers (the shortcut is in indirect.rs). The clamp no longer writes the copy of the title's memory; the capture's read-back reads the clamped records from the list's buffer. Tests: a transition log (every barrier built on the test thread) replayed in GPU order by the debug layer's rule: twin::tests::prelude_copies_start_ from_the_real_states (fails on the old order: "before COPY_SOURCE, the resource is in COMMON", run light21's message) and indirect::tests:: argument_buffers_move_from_their_current_states (two lists in either order; the title's copy untouched); the clamp tests now also check the whole title copy is as written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 15:41:46 +01:00 -
Shaders: quad reads in pixel programs reach the helpers at triangle edges
The console runs pixel programs in whole-quad mode: in every quad a triangle edge crosses, the pixels outside the triangle run as helpers, and the compiler takes derivatives of computed values (and quad reads) by reading the neighbour's register with DPP `quad_perm` or `ds_swizzle`. We lowered those reads to `WaveReadLaneAt` unless the program discards. Wave operations leave helper lanes out on the host, and on AMD a read of one gives 0: every pixel whose quad neighbour lies outside the triangle took a wrong derivative, along every triangle edge. WARP includes helpers in wave reads, so the tests passed there. Quad-local reads in pixel programs now always go through quad reads (`QuadReadLaneAt`), as they already did after a discard. What the host guarantees there: helper lanes execute the program so that derivatives can be taken, and quad operations include them (wave operations do not), so a quad read of a helper gives the value that helper computed, as the console's DPP read of a whole-quad-mode lane does. A discarded pixel stays a helper in the same way. Tests: two control-flow cases draw a triangle whose diagonal crosses quads (`ddx_fine`, `ddy_fine`, `QuadReadAcrossDiagonal`, `QuadReadLaneAt` of a computed value, console compiler against PC DXC). "derivatives and quad reads across a triangle edge": before, RX 6700 XT 24 of 256 texels differ (texel (0, 0): ddx -1 instead of 15, the helper read as 0), WARP 0; now 0 and 0. "discard, then derivatives and quad reads across a triangle edge" discards some neighbours before the reads (the path that used quad reads already): 0 and 0. Whole list (translate --list --validate): 3,005 pixel programs change, 84,589 read sites (median 15 per program, at most 732); no program changes outcome. DXIL 1,197,299,944 -> 1,203,716,752 bytes (+0.54 %) on top of the writer folding (on main without it: 1,423,424,800 -> 1,429,871,224), blocks unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 14:52:53 +01:00 -
Shaders: vertex, geometry and mesh programs with UAVs say so in their flags
Since the read marks, every vertex, geometry and mesh program that reads a texture from the resource heap writes the marks' UAV (the write marks do the same for programs writing through views), and its shader flags did not declare "UAVs at every stage" (ShaderFlags bit 16, SFI0 0x4): the validator refused 5,046 programs of the title's list with "Flags must match usage" (VS_OctaWindFire_e6901d4b: declared 0x40000010, actual 0x40010010). The runtime does not validate, so their pipelines were made, but a driver may trust the flags. The validator counts UAV ranges the module declares, not UAVs indexed from the heap: `finish` sets the flag (and the SFI0 bit) when a program that is neither a pixel nor a compute program declares any (root UAVs, the memory bitmap, the marks). Counting every handle annotated as a UAV instead set it wrongly for 26 mesh and vertex programs whose only UAVs come from the heap (`MST_DS_TerrainTransform` and others: declared 0x40092000, actual 0x40082000). Whole list (translate --list --validate), validated: vertex and pixel 13,313 -> 14,254 of 14,254, mesh 4,625 -> 8,694 of 8,765 (the other 71 have outputs over 32 KB), compute 1,984 of 2,732 unchanged (748 sample with implicit LOD); no program newly fails. Test: `emit::shader::tests::uavs_outside_pixel_and_compute_programs_are_declared` (a marked vertex, pixel and compute program and a vertex program writing a heap-indexed UAV each pass the validator; the marked vertex program fails as the list's did without the flag, the heap one with it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 14:52:53 +01:00 -
Shader tests: the differential harness binds the view-stride table
Since
4243a96a("16-bit typed buffer accesses pass bits through integer views") a 16-bit typed buffer access reads its view's format kind from the host's view-stride table, root SRV `t255` (`VIEW_STRIDES`), also for views in tables. The differential harness asserted that a translated program's root views are only the case's own (slots 4 and 5), so the case "16-bit and 64-bit arithmetic" (`RWBuffer<half4>` stores through `buffer_store_format_d16`) failed on its root SRV 255 before anything ran, in every run with the console compiler since that commit (eed16700passes,4243a96afails). `host::view_strides` builds the table as `victory_gpu` fills it for the harness's view heap (element sizes, the integer and signed bits of typed views of integer formats), and the harness binds it where a program asks. The case now runs and matches the console compiler's program on the RX 6700 XT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 14:51:28 +01:00 -
Shaders: one handle per descriptor at a fixed address, and per join
The console compiler reloads a descriptor before each use rather than keep it (`indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays` loads table offset 0x640 2,399 times, once before each of its typed buffer loads), and lowering made a heap handle at each load: index arithmetic, for heap buffers the host-view guard, `createHandleFromHeap`, `annotateHandle`. A descriptor resource tracking finds at a fixed address (a table or heap entry, no dynamic term, not a waterfall loop's per-lane load) now gets one handle for the program, made in the entry block from the root parameter's user data. A descriptor chosen by control flow (a phi of heap indices at a join) gets one handle made in its join block, shared by every access the join dominates, instead of one per access. Read marks still go with each access, at the handle's index. ActivateRays (with nested joins allowed, the commit after this one): 2,608 heap handles before the DXIL writer's folding, 674 after it, 65 with this. Whole list, translate --list --validate: 0 newly failing; DXIL bitcode 1,246,729,828 -> 1,197,299,944 (-4.0 %) bytes. Tests: `descriptors_reloaded_from_a_root_table_share_one_handle` (a descriptor loaded in a branch and again after it: one handle), written heap handles counted from the module (`Module::written_calls`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 14:51:28 +01:00 -
Shaders: the DXIL writer leaves out what no edge or reader reaches
Lowering leaves much in the DXIL that never runs or counts: branches on constants (lane conditions structurisation already knows, edges no lane takes) and the code only their other edge reaches, empty blocks that only forward to the next, size queries for descriptor words no path reads. The host driver compiles all of it. `indirect_diffuse_lighting:CS_ScreenProbes_ ActivateRays` (with nested descriptor joins, PR #1012) is where it showed: 8,745 of its 10,040 conditional branches were on constants, 10,061 of its 22,384 blocks empty forwarders, about 70 % of its instructions reachable only through constant branches' dead edges, and 556 of the 587 size queries in the rest unread; the AMD driver never finished it (over 6 GB at 64 s). The writer (`Module::plan`, `Module::kept`) now: * takes a branch on a constant as a branch to its one target: blocks only the other edge reaches are not written, and phis lose the entries of edges that are gone (their other entries stay); * folds an empty block with one predecessor into it (the predecessor branches to its target), unless it splits a critical edge (lowering keeps loops' exits and preheaders dedicated, as DXC emits them) or its predecessor would then reach the target twice (one phi entry per predecessor); empty latches fold as before; * writes only instructions with effects (stores, atomics, calls neither read-none nor read-only: barriers, discard, wave operations, the write and read marks) and what they read, transitively (it dropped only unread phis before); * declares only the functions it calls and the constant globals it reads (the validator refuses the others); * and the shader flags of heap handles, wave operations and 64-bit integers follow what is written (`Module::uses`; the validator refuses a flag whose use is gone, "Flags must match usage"). Whole list (shaders.rpf, the exe, XboxBvhBuilder, the upscaler; translate --list --validate, against
8ff79135): 0 programs change outcome (14,254 VS/PS, 2,732 compute, 8,765 mesh emitted; 13,313 / 1,984 / 4,625 validated, as before); DXIL bitcode 1,423,424,800 -> 1,246,729,828 bytes (-12.4 %), blocks 3,624,448 -> 3,554,816 (-1.9 %). ActivateRays itself is still refused here (nested joins); its table is in the commit that lets it through. Tests (`emit::bitcode`): a constant branch drops its other side and that side's phi entry only; a loop whose back edge is never taken; empty blocks before a phi fold only where the entry can move; only values with effects or readers are written (read-none and read-only calls, stores, atomics, barriers); constant globals nothing reads are left out; uses count only what is written. The writer's pinned bytes are pinned anew (its test module's last call became one with effects). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 14:51:28 +01:00 -
GPU: a texture refresh reads title memory into its thread's own buffer
What was wrong: each refresh of a tracked texture read the changed title memory into a buffer allocated for it, the texture's whole size (5.6 MB for a BC7 2048), zero-filled and touched page by page: a zero-fill and a page fault per 4 KiB for every texture brought up (129,071 page faults while preparing in one frame of run placed1). The detile itself is not the cost: a BC7 2048 64KB_D texture detiles at 0.04 ms per MB on this machine, as fast as a plain copy of its bytes, against ~2.2 ms per MB for a whole refresh. What changed: the read goes into a buffer the worker thread keeps for its next refresh (up to 32 MiB; larger ones are not kept). Only the touched spans are written, and only they are hashed and detiled, as before. In diagnostics builds, the scan of each texture read for all zeros runs only when its debug message is wanted. Evidence: the texture upload tests, which refresh several textures and single mips on the same threads, pass (victory-gpu 193 passed, twice). Run scratch1 (240 s of the intro cutscene, quiet, on the same main as run placed1): texture refreshes 177 ms of worker time for 98 MB a frame (1.8 ms per MB) against 235 ms for 105 MB (2.2 ms per MB). Its whole frame was slower (median 1,010 ms against 894) through GPU time (mean 450 ms against 318) and after-work, which this change does not touch: one run each, run-to-run variance not separated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 14:39:03 +01:00 -
GPU: lists wait on memory values; queues hold work until its waits hold
What was wrong: Wait32/64BitValueX were ignored and every submission ran when the title made it. Grand Theft Auto VI's four compute queues start each list with a wait for the frame's value of a word that a list on another queue writes at its end (Write64BitValueBottomOfPipeX), and some lists wait again after their first commands. Run light17's trace, one world frame (F = the frame counter, all comparisons GREATER_EQUAL): compute lists (kind 2), 22 queue submissions of one list each: wait [0xd0417fe00 + 16k] >= F at the start, write [+8] = F at the end (0xd0417fe00 .. 0xd04180070); the depth-processing list [w fe10][HBO dispatch, barrier][write fe18 at its end][w fe68, fee8]... graphics lists (kind 0) of 32-33-list submissions wait on words the compute lists write (list 1 after 7-8 commands for [0xd0417ff80], lists 3, 5, 7, ... at their start for [..ff90], [..ffa0], [..ffb0]) So CS_DepthProcessingHBO ran before the character G-buffer it reads, and CS_MaterialTilesInitial classified the head and hair as sky: the white-grey hair blob, faces dark or patched, the erased building bodies, the black shards in the sky and part of the skin's leopard patches. What changed: a wait recorded after commands cuts the title list into a new host list (`list::wait`, `State::cut` replays the fixed-function state and lets the next draw rebind the rest); each queue keeps a FIFO of list segments, Signals and fence Waits (`hold.rs`). The pump runs a queue's head once its waits hold, consecutive runnable segments as one host submission (a piece, its own submission for refreshes, marks, withholding and copy-back), and tests every queue again after each piece until none can move. Order within a queue never changes, only the interleaving across queues. A queue Signal behind held work is delivered after it (its fence is kept alive meanwhile); CPU fence Signals, GetCompletedValue and SetEventOnCompletion, PresentX, every submission and a 2 ms timer (values the title writes from the CPU) pump. D3D12 lets a list be reset as soon as it is submitted, which the title does up to 21 times a frame while its work is held: the held part keeps its own host list, its title list's draw state (dynamic descriptor slots, title-memory page table) and 0x4a0 memory, freed after it ran; host lists back from a queue are reused. Counted shortcuts (`shortcut:`): a head held 10 s runs anyway (valve); an unknown comparison holds; CopyPageMappingsBatchX and PresentX do not wait behind held work. The frame line (when work waited or is held): submissions, pieces, segments, cuts, early resets, segments that waited and what released them, the pump's own time, the title's fence-event waits, what is held at the present with the unmet waits. Evidence: run light18 (240 s, survived): per world frame 16-42 title submissions, pieces = submissions + 1, 188-266 segments, 0-11 cuts, 5-10 segments waited (55-1060 ms, every one released by a later submission); held at the present 0, valve 0, unknown comparisons 0, page mappings with work held 0. Hair whole against the sky, buildings whole, sky clean, skin clean, every face present and lit (13 faces in 8 close shots; act3 2700, without this, has a dark patch over the same woman's face). light19 (the debug layer, 240 s; median per world frame 30 submissions, 31 pieces, 236 segments, 9 waited; pump 1.1 ms a frame; no fence event left pending) and light20 (240 s, with the stale-upload fix now in main: 30, 31, 241, 9; pump 1.8 ms) survived; held at the present, valve, unknown comparisons and page mappings with work held 0 in all three. The debug layer's resource-state errors of light19 are on main alone too (light21, same kinds and rate): not from the new order. Tests: hold::tests (comparisons, a wait across queues, a wait that holds defers nothing, chained waits across two queues, order kept, a Signal after held work, a fence wait, work held at the frame's end, unknown comparisons, the valve) and the GPU test resource::tests::a_list_waiting_for_another_queues_write_reads_what_it_wrote (a compute list cut at its wait and reset while held reads back the plain texture the graphics list fills, as that list left it; on the old code it reads zeros). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 14:20:56 +01:00 -
GPU: textures fed from title memory are placed in heaps made ahead
What was wrong: every host texture was a committed resource, made one by one. A new shot brings hundreds of textures at once (the placed textures of slots shaders read for the first time, made after the submission), and making them took most of the copying-back phase: windows that made 337 / 134 / 110 MB of placed textures a frame spent 351 / 926 / 300 ms there (run shots2). Measured on the RX 6700 XT, 300 textures of a new shot's sizes (430 MB): committed 255 ms (not zeroed: 274 ms); one heap 32 ms, then placed 3 ms. What changed: textures without render-target, depth, unordered-access or simultaneous use, up to 16 MiB, are placed in 64 MiB heaps (default heaps for textures that are neither render targets nor depth), first fit, with castable formats through `CreatePlacedResource2` as the committed path uses `CreateCommittedResource3`; others stay committed, and so does a texture whose placement the host refuses. A texture's range is free again only once nothing else holds its resource (views' slots keep it until the running submission has run, lists until they are reset), checked at each placement and eviction pass; empty heaps past two are released. The eviction budget counts free heap space as unused. A texture whose memory is not committed when first read gets zeros, as a committed one starts (a placed one starts with what its range held); every other first refresh already uploads every subresource. The host-textures statistics line gives the heaps held and their used and free bytes. Evidence: tests `placement::tests::ranges_are_taken_first_fit_and_joined_when_given_back` and `a_range_is_reused_only_once_nothing_holds_its_texture`; the texture upload tests, whose textures are now placed, pass (victory-gpu 182 passed, twice). Run placed1 (240 s of the intro cutscene, quiet, on main with the narrower withholding of
0a5be3c7and the host-write fix): making the read slots' textures 23 ms a frame (median 12; the largest new shots 406 / 568 / 871 slots in 107 / 68 / 43 ms), against up to 926 ms before; copying back 109 ms against 223 (run shots2); world frame median 894 ms against 964. The whole-frame gain shares its main with the withholding change; the read-slot part is placement's alone. No device removal, no stale texels seen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 14:19:21 +01:00 -
GPU: a texture a host copy writes is the host's from the copy's submission
What was wrong: `texture::host_written` marked a texture as written by the host (a copy, copy-region or resolve into it) when the list holding the copy was recorded, and textures read through tables were checked only then, by `texture::upload` at record time. A list recorded before the writer but submitted after it kept its upload due: its submission uploaded title memory over the texels the host copy had written. Submissions need not run in the order their lists were recorded (`light` is changing the order to the title's own waits between queues), so this decision belongs to the submission. What changed: `texture::host_writes(list, resource)` marks the texture from the submission that runs the writing list (a deferred host step), and the submission's upload gathering skips table-read textures so marked, as the heap path already did. A reader submitted before the writer still gets its upload; one submitted after keeps the host's texels. Evidence: test `draw::tests::a_list_run_after_a_host_write_keeps_the_host_texels` (a reader recorded, title memory written, a later-recorded writer submitted first, then the reader: the host's texels stay). Without the submission-time check it fails (the title's new bytes, 0.502, uploaded over 0.251). victory-gpu tests 179 passed; workspace clippy clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 14:11:20 +01:00 -
GPU: only what programs using title memory write is withheld when their list misses
A list in which a program using title memory read or wrote memory with no copy had every range its shaders declared withheld from title memory (and, since
ec9e750e, dropped from the host copies right after the submission), whichever program declared it. The BVH builder's list also holds ordinary programs (run light13, one list: ~1,000 builder dispatches beside billboard_nobump:CS_ComputeImposterTransform x250, CSGenerateHairVB/IB, bvh_skinning, CS_InstanceRotationFixup), so their output never reached title memory and, after the drop, never reached the frame's later draws either. Now each declared range records whether its program uses title memory (the draw or dispatch being bound, `HostList::writer_uses_memory`), and only those ranges are withheld when their list misses. Other programs write through bounded views from their own inputs: their ranges go back as before the withholding. An ordinary range overlapping a withheld range of the same copy is withheld with it, since its copy-back would take the other's bytes along. Test: host::withholding::only_programs_using_title_memory_are_withheld (a missing list with an ordinary write, a title-memory program's write and an overlapping ordinary write; fails with the whole list withheld). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 13:21:09 +01:00 -
GPU: a submission's texture uploads become readable in one barrier batch
What was wrong: the upload list a submission runs first recorded, for each texture it brought up, the copies and then that texture's barrier back to shader reads, so every barrier sat between one texture's copies and the next one's. In a new shot the list holds hundreds of textures (154 MB a frame in run shots1), and each barrier kept the GPU from overlapping the copies around it. What changed: record_upload returns the barrier instead of recording it, and the upload list records all of them in one call after the last copy. Evidence: textures_uploaded_together_each_read_their_own_bytes (two textures uploaded by one submission each read their own bytes) and the other upload tests pass. Measured together with the staging chunks (run shots2, 240 s of the intro cutscene, quiet): world frame median 964 ms against 1,169 ms without the two (run shots1); GPU 313 ms against 351. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 12:27:24 +01:00 -
GPU: the textures of slots shaders read are made several at a time
What was wrong: after a submission, the placed textures of heap slots its shaders read for the first time were made one after the other on the submitting thread, and `texture_at` held its map's lock while making each host texture: in a new shot, hundreds of committed textures, 7 % of the submitting thread (run evict5). What changed: `texture_at` makes the host texture after letting go of its map's lock, and the read slots' placed textures are made on up to four threads (a quarter of the CPUs), with the helper the texture refreshes use. Evidence: test `resource::tests::placed_textures_made_side_by_side_are_one_each` (four threads asking for four memories: one resource and one host texture each) and `descriptor::host::tests::views_written_while_read_slots_get_their_textures_do_not_wait`; the crate's tests twice with 8 threads. Measured alone (run shots1: main
8ff79135and this commit, 240 s of the intro cutscene, quiet): world frame median 1,169 ms against 1,206 ms before (run evict6), preparing 706 ms against 709: a small gain; the staging chunks and the barrier batch carry the rest (run shots2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 12:27:24 +01:00 -
GPU: textures' staging space is carved from large upload buffers
What was wrong: each texture brought up took a staging buffer of its own size class from a pool, and the pool's free buffers rarely fit a new shot's sizes: making upload buffers was 10 % of the submitting thread in a new shot (run evict5), one committed resource per texture. What changed: staging space up to 32 MiB is carved, front to back, from 32 MiB upload buffers, 512-byte aligned as texture copies need; the copies read their footprints at that offset. The chunks are rewound at each submission (the last one has run, as for the pool) and 16 are kept. Larger textures keep a buffer of their own from the pool. Evidence: test `draw::tests::textures_uploaded_together_each_read_their_own_bytes` (two textures brought up in one submission, the second at an offset in the same chunk, each read back with its own bytes) and the upload tests; the crate's tests twice with 8 threads (a timing test of frame waits, `frame::tests::waits_end_on_ticks_and_count_frames`, failed once while a title run loaded the machine, and passed in the other run). Measured together with the upload barrier batch (next commits' run shots2, 240 s of the intro cutscene, quiet): world frame median 964 ms (mean 1,038) against 1,169 ms with only the parallel creation (run shots1) and 1,206 ms before (run evict6); preparing 497 ms against 706; texture refreshes 264 ms for 135 MB a frame against 745 ms for 154 MB. The two were not measured apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 12:27:23 +01:00 -
Shader: rectangles complete opposite their right angle, wherever it is
A console rectangle list gives three corners per rectangle and the hardware adds the fourth opposite the right angle. The geometry shader that completes them on the host (and the CPU expansion used without it) took the right angle to be at v1, as the blits give it (top left, bottom left, bottom right). The tiled lighting's vertex shader (VS_TiledLighting, 3 vertices per tile: corner c = vertex % 3 at x + bit 1, y + bit 0) gives top left, bottom left, top right, the right angle at v0, so every lighting tile drew its upper-left half and the lower-right half of the tile above: tiles whose neighbour below was in another list lost their lower-right half and lit the one above, the right-triangle wedges along silhouettes and kerbs of runs shards22 (frames 1603, 1615, 1627; their depth is clean there). Now the right angle is the corner opposite the longest side (`emit::right_angle`, ties and NaN keep v1), the fourth corner is va + vb - vc and the second triangle (va, vb, v3), turning as the first for any three points; the CPU expansion takes the same rule from the first float element of two or more components. Tests: emit::rect::rule_tests::right_angles_are_found_in_any_order; emit::rect::tests::rectangles_get_their_fourth_corner draws the three orders (and three points on a line, which draw nothing) on hardware and WARP, and fails with the old rule; primitive::tests:: rectangles_complete_opposite_their_right_angle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 11:04:03 +01:00 -
GPU: what a submission that missed title memory withheld leaves the copies at once
What lists using title memory write while the frame withholds stays in the host copies until the frame's end: through the page table, through root views (byte for byte) and through marked views. When a list of the submission read or wrote memory with no copy, those results are garbage computed from zeros (BVH builder nodes: +-inf bounds, 0xffffffff, rising u16 pairs), and later submissions of the same frame read them from the copies: in run shards20 the meshlet culling read such bytes in its per-batch meshlet buffers (stale copies with no title-side event after their take; 95.59 % of the batches walked equal to title memory). Now what such a submission withheld counts as changed in every buffer copy holding it right after it completes (`drop_withheld`, which takes the place of `drop_at_frame_end`), so the next submission's refresh takes it from title memory again. What submissions that missed nothing withheld keeps the frame-end retake. Run shards21 (
29210929+ the page-table part alone + branch-only diagnostics, same listing as shards20): one list per world frame wrote through the page table, every one missed and was retaken at once (34-19,446 pages); stale copies written through the page table are gone, 98.12 % of 13,509 batches walked equal title memory. Every sampled stale batch left was last written through a declared, unmarked view with no retake after it (the builder's root UAVs, which the page-table path leaves to the byte-for-byte path), hence the root and marked views here too. Test: memory::tests::a_submission_that_missed_leaves_the_copies_at_once (a write through the page table beside a miss; fails before the change: the next submission reads the write instead of title memory's bytes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 10:44:44 +01:00 -
GPU: textures are brought up outside the heaps' locks, several at a time
What was wrong: at each submission the textures to bring up were read from title memory, detiled into staging buffers and copied one after the other on the submitting thread, while the heaps' view registry stayed locked: in a new shot that was about a third of the submitting thread (reading memory 19 %, making staging buffers 10 %, detiling 6 %, run evict5), frames grew 6-10 ms per MB uploaded, and title threads setting views waited on the lock throughout. What changed: what to bring up is collected under the heaps' locks, then refreshed without them on up to four threads (a quarter of the CPUs), those whose trackers are clean skipped, then recorded. Staging buffers come in powers of two (at least 64 KiB), so a buffer serves other sizes, and are made without the pool's lock. The tracker still decides the bytes: its pages are taken (and guarded) before they are read, so a title write during the read or detile marks them again and the next refresh brings them up (`watch::tests::writes_mark_every_tracker_of_their_page`). Evidence: tests `host::tests::heap_textures_brought_up_together_each_get_their_upload` (six textures refreshed side by side, each uploaded once, none again when unchanged) and the upload tests; the crate's tests three times with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:25:12 +01:00 -
GPU: what a view needs is made before its slot's lock is taken
What was wrong: making a heap slot's view held the heap's slot lock throughout, including making the texture it views (on first use) or the host copy of the buffer memory it views: title threads binding views for draws and writing views waited on that lock (119 of 307 samples of title threads in our code, run evict5). What changed: a slot whose view is unchanged is answered under the lock as before. One to make again releases the lock, makes what the view needs without it, takes it again and, if the slot still holds the record it prepared for, makes the view (cheap now); if the title wrote another record there meanwhile, that record is made instead. Evidence: tests `descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait` (a thread binds a view while another slot's texture is made, bounded wait) and `a_slot_rewritten_while_its_view_is_prepared_views_the_new_record` (the title writes another record into the slot during the prepare; the slot views the new record's texture); the crate's tests three times with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:25:12 +01:00 -
GPU: a texture's refresh asks its tracker's clean bit before taking its pages
What was wrong: textures the heaps view are refreshed at every submission where the title used them lately: 123,000 refreshes a frame (run evict3), each taking its tracker's lock to find, almost always, nothing changed. What changed: a refresh of a tracked texture first reads the tracker's dense clean bit, which needs no lock, and stops there if it is clean. Evidence: the upload tests (`draw::tests::a_texture_is_uploaded_once_per_submission_and_only_when_written`, `a_texture_owning_its_pages_is_uploaded_on_any_write`, `a_write_into_one_mip_uploads_that_mip_alone`); the crate's tests twice with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:25:12 +01:00 -
GPU: a slot the title rewrites keeps no per-texture list of slots
What was wrong: every slot the title rewrote updated a map from each host texture to the slots viewing it (for giving textures up), searching the texture's whole list to take the slot out. A texture viewed in thousands of slots made each rewrite cost ~25 us; the title rewrites ~62,000 slots a frame (it copies per-draw descriptor tables into its heap), so heap syncs took 0.6-2.9 s a frame and held the heaps' lock that title threads writing views wait on (run evict3: 62,208 stale slots a frame at 25.7 us each, 16 us rising to 34 us as the lists grew). What changed: no map; giving textures up walks the heap's slots once per pass that gives any up. Evidence: tests `descriptor::host::tests::a_slot_viewing_a_texture_given_up_is_made_again_when_read` and the eviction tests; the crate's tests twice with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:25:12 +01:00 -
GPU: textures for heap slots shaders read are made outside the heaps' lock
What was wrong: after each submission, the views of heap slots shaders read for the first time (read marks) were made under `SHADER_HEAPS`, which every title thread writing a view takes: making a placed texture (its resource and host texture) took up to milliseconds each, and title threads waited 1-6 s a frame to write views (runs evict2, noevict1; main 0.2-0.3 s). What changed: the slots are looked up under the lock, the placed textures they view are made without it (they are never released, so they outlive it), and the lock is taken again only to make the views. Evidence: test `descriptor::host::tests::views_written_while_read_slots_get_their_textures_do_not_wait` (another thread writes a view while a read slot's texture is being made and finishes within a bounded wait); the crate's tests twice with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:25:12 +01:00 -
GPU: textures the heaps view are brought up to date only when shaders read them lately
What was wrong: at every submission (about 30 a frame), every texture any heap slot of a heap-indexing list viewed was brought up to date: its staging refreshed and, where its pages had changed, detiled and uploaded, read or not. With placed textures made when read (4-8k textures, 5-8 GB viewed by the heaps) that re-uploaded about 4 GB in 30-46 world frames and took 0.3-3.7 s a frame (runs evict2, noevict1; main 5-25 ms). What changed: a heap-viewed texture is brought up only if the title used it in this presented frame or the last (made then, named by one of its lists, or read through the heap as the eviction pass's stamps found). Textures lists read through tables keep their own rule (the list names them). Uploads of heap-viewed textures are counted with the others. shortcut: a texture read again after a gap is brought up after the submission that read it, which can see bytes one refresh old. Evidence: test `host::tests::heap_textures_unread_lately_are_not_brought_up` (a viewed texture whose pages changed is not uploaded while not read lately; stamped as read, it is); the crate's tests twice with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:25:12 +01:00 -
GPU: host textures fed from title memory are given up when unused, and past the card's budget
What was wrong: a host texture, once made, lived as long as its title texture; placed textures (made when shaders read them) for the whole run. The title views far more textures than one frame reads (8.4-8.9 GB of placed textures left null in run textures1), so making them as they are read only grows video memory until the card pages or the process runs out of commit (30.8-32.2 GB with the read marks alone). What changed: a title texture's host texture can be given up and made again on its next use (the owner is a resettable slot; host copies are returned owned). Host textures fed from title memory (no render target, depth or unordered access, nothing written by host copies) carry use stamps: a list of the title's naming them (tables, copies; our own upload lists do not stamp), and, at each pass, every read mark set since the last pass on a heap slot viewing them (the marks are then cleared; a slot's read is reported as new only once, so stamping on the first read alone gave up textures read every frame: run evict1 gave up and made again hundreds a frame). Once per presented frame, before a submission, those unused for 120 s and 300 presented frames are given up (shorter idle times gave up textures read again within a minute, runs evict2 to evict4), and past 90 % of the card's budget the least recently used others until 85 %. Giving one up first gives every heap slot viewing it a null view of its kind (retired until the running submission has run; the record stays noted, so heap syncs pass it by and a draw's or shader's read makes it again), then the title textures let go of it; lists recorded before hold it until they are reset, so no GPU work reads it freed. The next use makes it again from title memory (a fresh upload). Uploads of heap-viewed textures skip those not made. GPU-written textures are never given up; they go with their title texture. The cap on placed texture bytes is gone (the budget bounds video memory instead). Measured, 240 s of the intro cutscene each. With giving up (run evict2) against without (noevict1, the same tree with the pass off): card memory flat at 7.6-9.5 GB against 6.4 GB rising to 10.4 GB (86 % of the budget) at the end; host textures 6.1-7.8 GB against 5.2 GB rising to 8.6 GB; process commit 26.2 GB against 27.7 GB on average (29.7 GB and rising at the end). With the rest of its stack (run evict6) against main (perf13): median world frame 1,206 ms against 475 ms; frames uploading under 50 MB of textures 559 ms (+18 %, run evict4); a new shot's uploads cost 3-4 ms of frame per MB. Evidence: tests `host::tests::textures_read_every_frame_stay_and_title_lists_stamp_theirs`, `host::tests::heap_reads_since_the_last_pass_name_their_textures`, `draw::tests::a_texture_given_up_is_made_again_with_its_bytes_and_recorded_lists_keep_it`, `descriptor::host::tests::a_slot_viewing_a_texture_given_up_is_made_again_when_read`, `resource::tests::only_textures_fed_from_title_memory_are_given_up` and `resource::tests::idle_textures_go_and_past_the_budget_the_least_recently_used`; the crate's tests three times with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:25:12 +01:00 -
Shader: the read-mark test's doc comment is no list
Clippy (doc_lazy_continuation) took the wrapped "1." for a list item. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:29 +01:00 -
GPU: read marks are taken from both written-page bitmaps
What was wrong: shaders that use title memory got a bitmap of their own (the withholding rule), but `take_reads` still read one bitmap through `bitmap()`, which no longer exists: the stack did not compile, and reading only one bitmap would lose the reads those shaders mark. What changed: `take_reads` ORs the read-mark words of both bitmaps and clears a forgotten slot's mark in both. Evidence: test `host::tests::read_marks_of_both_bitmaps_are_taken` (a read marked in each bitmap is taken, each once; a forgotten slot's mark is cleared and its next read taken again). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:29 +01:00 -
Shader: read marks only for texture views taken from the heap itself
Every image instruction reading a texture view from the resource heap loaded the read-marks bitmap word (system memory) after it, tables included. A view read through a table cannot be a slot left null: the host makes table slots for the draw. Marks are now emitted only where the program takes the descriptor from the heap itself. Test: `heap_direct_texture_reads_mark_their_heap_index` (a table read marks nothing, a heap-direct read sets exactly its slot's bit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:29 +01:00 -
GPU, Shader: placed textures made when shaders read their heap slots
Views of textures the title placed itself (device 0x230, no resource object; its streamed textures) were left null until a draw read them through a table: making all of them never fits the card (run textures1: 12-16k such slots at ~12.5k addresses, 8.4-8.9 GB of console bytes), and shaders index the heap themselves, so materials sampling through the heap read black. Translations made with `emit::Options::view_marks` now also mark reads: every image instruction reading a texture shader view from the heap sets bit `VIEW_READS` + the view's heap index in the views' marks bitmap (after the written pages), where still clear (a load first, an atomic OR only then). After each submission the host takes the newly set marks and makes the views of those slots that were left null, so the next submission reads the texture; a slot made null again is forgotten so its next read marks it again. Placed textures stop being made past 3 GiB of console bytes (`shortcut:`, no eviction yet). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:29 +01:00 -
Shaders: a test of register arrays indexed in waterfall loops
`tiled_lighting:CS_PrescalarizeLightLoop` builds its per-tile light masks in v3-v14 with `v_movrels`/`v_movreld` whose M0 each lane takes from its own group index (clamped 0-11 by `v_med3_u32`) in waterfall loops over the lanes. The new GPU test runs that shape twice (the second pass reads what the first wrote) and checks every element of every lane, on hardware and WARP. It passes: the lowering of the shape is right; what the program writes in the title depends on its inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:28 +01:00 -
Shaders: lanes skipping a compare's region read 0 of its lane mask
A lane mask made by a compare inside a region some lanes skip, joined after it with whatever the register held on the skip edge (the compiler reuses the register: a float, a descriptor word), stopped programs on "a lane-mask join of an untracked mask". The console wave runs one path: where some lane ran the region, the skipping lanes read their bit of the compare, 0 (a compare writes 0 for inactive lanes); the compiler merges no value for them, so where the whole wave skips they hold none either. A lane-mask phi at a per-lane join now takes false along an edge bringing data when some edge brings a mask and no lane taking the data edge is in any of those masks (proved on the lane conditions, `Bools::meet`). Masks that do hold such lanes (a saved EXEC) stay refused: the console would give those lanes 1. Test: `a_compare_mask_joined_with_data_on_the_skip_edge_is_0_there` (the shape on hardware and WARP; the saved-EXEC variant refused). Shader list against bcebd1ce: 0 newly failing; newly emitted `rtdirectionalshadows:CS_RTShadowTrace32TemporalHQ_OneOver4RPP` and `_OneOver2RPP_TiledFarOnly`, `shadowmask:CS_TraceShadowRays_FullAdaptive`. The other 13 `RTShadowTrace*HQ` stay refused: their register is reused on paths that reach a real mask read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:28 +01:00 -
Shaders: a scalar VALU result takes no EXEC guard
`indirect_light_probes:CS_IrradianceCache_Shade_823aad37` (the GI irradiance cache, in the intro cutscene 2 dispatches a frame and 2 indirect ones) stopped on "a lane-mask join of an untracked mask". The lowering evaluated every VALU instruction's guard before its operation, also for `v_readlane_b32` and `v_readfirstlane_b32`, whose scalar result is written whatever EXEC holds and never used the guard. At 0x14bf0 the program restores spilled masks with `v_readlane` under an EXEC taken from s[6:7], a join of a restored mask and, on the edge where every lane skips the region, the constant 0; the next instruction sets EXEC again. Building that EXEC as a lane condition was the only demand for the join. `valu` now takes the guard only for vector destinations (compares, which write lane masks, are lowered before it as before). Test: `a_scalar_result_needs_no_exec` (that shape; refused without the change). Shader list against 10d24b19: 0 newly failing; IrradianceCache_Shade emits and makes a pipeline (4 s, 0.3 GB; the validator refuses it as other compute programs with implicit-LOD samples). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:28 +01:00 -
Shaders: an image descriptor read only for its size takes it from the host
`PS_PuddleDetect` (35 programs; in the intro cutscene ~14 draws a frame, half of them indirect) loads a bindless texture's descriptor whole and reads only its width, height and base level from dwords 1-3, never sampling it, so no use tells the view's kind and the program stopped on "a descriptor read only as data". The host's view addresses (`t1` of the memory space) grow from 8 to 16 bytes a slot: a console descriptor's dwords 0-3 as far as the host knows them. Buffer views keep their title address in dwords 0-1; texture views (shader, unordered and placed ones) get the image descriptor's size fields: width - 1 and height - 1 of the resource's level 0 (dword 1 bits 30-31, dword 2 bits 0-13 and 14-29), an identity swizzle, the view's first and last level (dword 3 bits 12-15, 16-19) and the image type (bits 28-31). The shader answers dwords 1-3 from the table only for an 8-dword load at a whole descriptor (the compiler loads image descriptors whole); shorter loads keep dwords 2 and on refused, so buffer record counts and formats are not guessed. Address, format and tiling bits of a texture's words read 0 (`shortcut:`). Tests: `a_texture_view_gives_its_image_descriptor_size_fields` (the encoding); the title-memory GPU test reads an image descriptor's size words through the table. Shader list: all 35 `PS_PuddleDetect` emit and validate; the cutscene's two variants make pipelines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:28 +01:00 -
Shaders: an address half set on every taken edge into its join is known
An address's high half proven to be 0 (a table or heap address) had to be that constant itself or an `s_addc` of it. `indirect_light_probes: CS_Alpha_Schedule` sets its table pointer's high half (s25 = 0) inside the region that only a skip no lane takes bypasses (compute: every lane runs from the start, so the pre-`s_wqm` lanes are all of them); the skip edge would bring a stale input SGPR, and the join stopped tracking: "an address into a descriptor heap with an untracked high half". A phi whose args on the edges some lane takes (`edge_taken`, the test the previous change uses for descriptors) all have one origin holds that value in every lane that reads it; the address's high half check now looks through such a phi. Only the proof changes: the address lowered is the traced one. Test: `an_address_half_set_where_only_lanes_that_never_run_skip_is_known` (refused without the change). CS_Alpha_Schedule translates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:28 +01:00 -
GPU: a texture re-detiles only the subresources whose pages changed
What was wrong: a tracked texture whose memory changed anywhere was read whole, detiled whole and copied whole into its host texture. Streamed textures change mip by mip, so each arriving mip re-read every other one: up to 430 MB of texture reads a frame in run integ2. What changed: each subresource knows the bytes of the texture's memory it lies in (its first and last texel's offsets in the layout, rounded out to the layout's blocks). A refresh reads only the subresources that the changed ranges touch, keeps those whose bytes changed (per-subresource hashes; none when a whole changed page lies in the subresource's span, as for the whole texture before), detiles and copies only those. The untracked path, which hashes the whole memory, still uploads every subresource. Evidence: test `draw::tests::a_write_into_one_mip_uploads_that_mip_alone` (a 512x512 two-mip texture: both mips at first, then mip 1 alone after a write into it, mip 0 keeping its texels) and the other draw tests on WARP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:24:28 +01:00 -
GPU: texture staging buffers come from a small shared pool, not one per texture
What was wrong: each uploaded texture kept an upload buffer of its own size for life, in system memory: 0.2 GB on main (run textures5), 2.6-2.8 GB once placed textures are made when shaders read them (run integ2). Making a buffer for every upload instead (066fbbeb, run textures8) released them, but the menu movie, which rewrites 12.7 MB of textures every frame, then paid ~5 ms a frame for fresh buffers: texture preparation 12.7-13.8 ms in textures8 against 8.0-8.4 in textures7. What changed: every upload is recorded at submission by the submission's own list (
23a4b62b), and `Host::execute` waits for each submission, so a staging buffer is free again from the next submission on. Detiles take a buffer of the same size from a pool shared by all textures, or make one; the buffers one submission used go back to the pool before the next one's uploads, and the pool keeps at most 64 MiB of free buffers (oldest dropped). The staging state keeps only the layout, the change tracking and the last hash. The memory line no longer gives "texture staging". Evidence: textures8 (one buffer per upload) ended at 7,871 MB of system memory and 24,771 MB of commit against textures7's 8,254 and 25,130 (206 MB of staging gone), no out-of-memory and no removal in 200 s. Test `draw::tests::a_texture_owning_its_pages_is_uploaded_on_any_write` now also checks that a reused buffer carries the new bytes (WARP). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 10:24:28 +01:00 -
HLE: writes into physical pages are reported where the pages show when the write ends
DirectStorage writes streamed data into physical pages through views of its own and then tells the title views showing those pages, so that the GPU side's host copies of them take the new bytes. The list of addresses was looked up when the write started. A page window's decode (zlib or BCPack) takes milliseconds, and the title maps streamed pages into its GPU heap meanwhile (CopyPageMappingsBatchX): the remap marks the copies there, a refresh can take the page before the bytes land (zeros, or part of them), and the report at the end named only the old addresses, so the copy at the new one stayed stale with a clean tracker for good. The addresses are now looked up when the write ends (PageWindow::drop, after the copy in write_physical). An address mapped during the write is reported; one that stopped showing the page during the write is not, and needs not be: the unmap itself marked the copies there, and they read the address's new contents at their next refresh. A mapping made after the report is marked by its own remap. Test page_windows_report_where_the_pages_show_when_done: a page shown at A is mapped at B and unmapped from A while a window writes it; the drop reports B only (and write_physical the same). On the previous code it reports A. Found with the meshlet culling's copies: in title runs 5-8 % of culled batches read meshlet buffers whose host copies (4 MiB windows over the GPU heap's mapped pages) held zeros where title memory held the buffer, with the tracker clean: whole batches culled, run-dependent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 10:07:13 +01:00 -
GPU: a retake marks host buffer copies alone, not textures' staging
What was wrong: a retake (what a frame withheld leaves the host copies) marked the memory changed in every tracker holding it: host buffer copies, but also textures' staging and descriptor heaps, whose contents come from title memory, which did not change, and which shaders' writes never reach. Placed textures over withheld ranges (every world frame withholds 280-9,300 pages) were detiled and uploaded again each frame: 97 MB a frame, 19 % of all texture uploads (run evict3, by each page's last reason). What changed: trackers of host buffer copies are made by `watch::track_copy`, and a retake marks only those. Evidence: test `watch::tests::a_retake_marks_buffer_copies_alone` (a copy's and a texture's tracker over one range: the retake marks the copy's alone, a later title write marks both); the retake test now uses copies' trackers. The crate's tests twice with 8 threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

MarvisandClaude Opus 5.5
2026-11-25 09:50:22 +01:00 -
GPU: a retake marks the copies without opening their guards
At every presented frame the copies of title memory a withholding frame's shaders wrote take it again (`retake_dropped`). `retake` did that through `changed`, which also gives write access back to every guarded 64 KiB page of the range, one VirtualProtect each, under the guard lock that title threads' guard faults wait on. Title memory did not change, so opening the guards bought nothing: the next take only re-guarded them, and title writes meanwhile went through unseen by the guard (marked anyway by the retake). Run perf15 (stack samples every second over the intro, main
38994e53): 15.4 % of the submitting thread's samples were in retake -> changed_here, waiting in the kernel, the largest item after the GPU wait (30.8 %) and the refresh copies (23.1 %). Now a retake marks the pages changed in every tracker holding them and in the trackers of their other mappings, and leaves the guards in place: the next refresh copies the pages from title memory, `take` finds them guarded already, and a later title write still faults and marks them. The test fails with the old body (the page comes back read-write). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarvisandClaude Opus 5.5
2026-11-25 09:37:58 +01:00