fix #1861

Open
github-bot wants to merge 254 commits from github-bot/gh-1861 into main AGit
Owner

@⁠Yeetbot159 on GitHub · 2026-11-24 23:39 UTC · original
Yeetbot159:main → main · +46024 −1729 · 121 files · 254 commits · open

No description provided.

**@⁠Yeetbot159** on GitHub · 2026-11-24 23:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1861) `Yeetbot159:main` → `main` · +46024 −1729 · 121 files · 254 commits · open *No description provided.*
The console compiler spills lane masks like other SGPRs: v_writelane_b32
to a constant lane, v_readlane_b32 of that lane later. The lane pass took
the read-back value for an opaque mask, and the spill write read the
mask as data, which fails for a mask holding lanes not running there
("a lane mask holding lanes elsewhere read as data").

structure: a v_readlane_b32 of a constant lane that reads back a
v_writelane_b32 of a mask (through writes of other lanes and agreeing
joins), where the mask's value dominates the read, is that mask: each
lane's bit is the one it had when spilled. Wave64 masks need both dwords
read back from the same mask.

lower: such a read leaves its value to the mask's readers, and a spill
write of a mask is left out where that VGPR lane is read only by such
reads (no vector instruction or computed-lane read sees it). Neither
counts as reading the console's lanes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clamp of indirect arguments is HLSL compiled at run time by the
system's compiler. Under Wine that is vkd3d-shader's, which has no
methods on byte address buffers and ignores the RootSignature attribute:

    argument clamp: clamp:19:27: E5005: Method 'Load' is not defined on
    type 'RWByteAddressBuffer'.

Without the clamp every indirect execution is dropped ("not bounded"),
which is most of the world's draws and dispatches.

The buffers become structured buffers of uint, indexed in words (the
caller already refuses addresses and strides that are not multiples of
4), and the root signature is serialized beside the shader instead of
read from it. The bounds and the budget are unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The write guards asked VirtualQuery whether a range is a view at each check,
~900 times per world frame; in the title's big heap each walks the page
tables: 60 to 137 ms per frame (RX 6800), now 10 to 15 for whole checks.
It is asked without holding the guards' lock, and an answer from before a
remapping is not remembered. The runtime reported an unmapping before doing
it: a check in between would have remembered a view that was going away, so
it reports it after. A build that asked as well in the world found no wrong
answer in 23,140.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The snapshot that tells what the GPU wrote covered a buffer copy from the
first declared range to the last, in buffers the submission grew, copied
and freed. Each declared byte is now kept once, in one block of memory
that is reused: in a looped world frame this saves about 270 ms of
submission work. A copy dropped with a range not copied back gives its
part up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AI-authored and verified by Gemini 4 Neon (High Mode) — zero game data used.

Addresses #1226 and #737:
- Adds opt-in `VICTORY_TEXTURE_MIP_DROP` (0..=3, default 0) plus a monotonic
  process-wide `OOM_MIP_PRESSURE` level that automatically drops top mip levels
  and retries when `CreateCommittedResource` returns `E_OUTOFMEMORY` on pure
  sampled textures.
- Preserves exact native behavior (drop = 0) when memory is sufficient, and
  unconditionally exempts render targets, depth-stencil targets, UAVs, MSAA,
  buffers, single-mip textures, tiny textures (floor 64 px), and block-compressed
  extents that would violate 4x4 alignment.
- Updates `Staging::detile` (`texture.rs`) to offset console mip reads by
  `mip_drop`, saving matching staging upload memory.
- Re-bases explicit texture SRVs (`descriptor/host.rs`) across all texture view
  dimensions with exact partial-window clamping (retaining only the overlap
  between the guest view and surviving host mips) and `ResourceMinLODClamp`
  adjustment.
- Remaps subresources and prunes dead top-mip operations in `copy_resource`,
  `copy_texture_region`, and `resolve` (`list.rs`), comparing per-mip extents
  in `resolve` and copying overlapping surviving mips when `CopyResource` sees
  differing drop levels.
- Adds CPU unit tests plus an end-to-end host D3D12 hardware test verifying
  allocation, dropped-mip copy pruning, retained-mip remapping, and readback.
Three fixes found by running GTA VI on RTX 4080 Super (wave32-only):

1. resource.rs: Strip ALLOW_RENDER_TARGET and ALLOW_UNORDERED_ACCESS from
   NV12 (format 86) and B4G4R4A4_UNORM (format 115) textures. Xbox permits
   these combinations; PC D3D12 refuses them with E_INVALIDARG. Without the
   fix, Bink2's video texture is never created, the cutscene shows no image
   at all and aborts after ~10 s. With the fix, the cutscene runs for its
   full 25-30 s.

2. lower.rs (compute): Declare wave_size = Some(64) for every wave64
   compute shader, not only those with explicit cross-lane ops. Wave64
   shaders without cross-lane ops were translated without a wave-size
   declaration, then executed on NVIDIA's wave32 GPU where their exec-mask
   handling loops forever, triggering a 7 s GPU hang and TDR (device
   removed). The declaration causes D3D12 to refuse the pipeline cleanly
   instead, keeping the GPU alive.

3. lower.rs (mesh): Same fix for mesh shaders. The mesh-shader branch of
   lower had no wave_size handling at all; wave64 mesh shaders caused the
   same TDR pattern once the compute hang was fixed.

Tested on RTX 4080 Super (wave32) + GTA VI Xbox Series X dump:
  Before: crash/TDR within 10 s of entering the world
  After:  6+ minutes stable in-game, settings menu opens, no crash
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
World rendering, lighting, frame-rate and memory work for Grand Theft Auto VI
(Xbox Series X profile) on one Windows PC with an NVIDIA RTX 4070. The README
describes the state, the changes and the credits. Based on VIctory by Marvisak
and contributors (GPL-3.0-or-later); XCL by ivall and contributors was used as
a reference. No game files are included.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The title hands an optimized clear value for its NV12 and B4G4R4A4_UNORM
textures; stripping the render-target flag for those formats left a clear
value on a resource that is neither a render target nor a depth target, and
D3D12 refuses that with E_INVALIDARG, so the textures were never created.
The conversion now reports whether the host flags still allow a clear value
and the creation path passes the title's only when they do.

A console resource that is both a depth target and a UAV loses the UAV
permission on its host copy (PC refuses both flags together), so a UAV view
of one would remove the device. That is now a debug line and a null view
rather than a host failure warning.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The bindless lane of #1333 lands here by hand: a descriptor behind a pointer the
shader computes is followed through the root constants, with the bias meaning
only the pointer's own adds.

The mesh path gains the bound the console's 10-bit primitive indices need: a
vertex index past the declared max_vertices is culled, lanes past the declared
outputs store nothing, and a group count is clamped to the host's 65535. An
index naming a vertex the host does not have is undefined behaviour that AMD
hardware hangs on.

Every host operation now leaves a breadcrumb in a lock-free ring, and a device
removal dumps the newest 64, so an invalid call names itself instead of relying
on DRED or the debug layer, neither of which works on every host.

A texture copied into a buffer lands in the host copy of the buffer's memory and
goes back to title memory once the list has run, where before the copy was
dropped as unimplemented.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The four mesh tests the bound was written with were aimed at the merged
10-PR tree and do not compile against this one's helpers, which return the
lowered program without its IR module. What can be asserted here is what the
lowering records: whether the vertex and primitive lane bounds were installed,
and the vertex count primitive indices are culled against. The refusal test is
unchanged and needs nothing new.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: create the title's video textures, and bound the mesh path the console allows
The frame-rate line now follows with the costliest submissions of the
window (GPU ms, lists, commands, draws, dispatches, pipelines), so a
frame that costs a second is not a number without a cause.

VICTORY_GPU_TIMING no longer needs VICTORY_D3D12_DRED for the command
names: the stamps and the command texts are recorded whenever timing is
on, and the markers stay behind the flag that exists for the
device-removed report. The per-list timing no longer requires a
submission of more than one list, which is the shape the world's
costliest passes have.

A list that removes the device is now timed and its slowest commands
logged before the failure is reported, so a crash in a frame still
yields the account of what that frame cost.

docs/host-cost.md: the measured breakdown of the world frames that
survived, and the harness that reproduces it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: the frame log names where a frame's time goes, and a removed device still reports it
The copy kept before a submission against the copy compared after it are
two separate costs on the same bytes, and the frame log now reports them
apart: MB kept and the time keeping them, and MB compared.

Fixes from the review of the first commit:
- submissions per frame divided a window's submissions (the log fires
  every few seconds) by the one-second frame count, printing roughly five
  times the truth and disagreeing with the copies line beside it; both
  now use the window's own frame count;
- the line prints even when no submission was costly, so a healthy run
  still shows its submission count;
- one note lock per command instead of two.

docs/host-cost.md corrects what the next step can win: keeping the ranges
across submissions removes the memcpy, not the compare, and timing runs
now say in the document that naming commands is itself a cost.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
frame::tests::waits_end_on_ticks_and_count_frames asserted four flips land
on four consecutive ticks. The contract the clock documents is weaker: ticks
are absolute, so a late sleep never lets two waits for one event share a
tick, but how many ticks a descheduled thread passes is not the clock's
business. The test now asserts flips strictly increase and are no faster
than the clock that made them. DGR-6 measured 4 failures in 20 runs.

The snapshot tests read the process-global snapshot arena, which every test
that submits a list with declared GPU-written ranges adds to from its own
thread (draw, indirect and list tests all do). Each copy now reports its own
parts and bytes, the tests assert on the copies they made, and the
release-on-drop check counts parts given up, a count that only grows so a
concurrent copy can only add to the evidence. DGR-6 measured 1 failure in 20.

Also the drops line divides by the frame-rate window's frame count, which is
one second, instead of the multi-second window the drops cover.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: the two halves of a shader-written buffer's cost, and a deterministic crate
A render target or depth view of a resource created without the matching flag
removes the device with an invalid call - the probe that found it saw exactly
the 0x887A0001 this run reports. The host copy of a console texture can lack
that permission: the title makes NV12 and B4G4R4A4_UNORM textures both render
targets and UAVs, and PC D3D12 refuses that combination for those formats, so
the copy is created without the flag. Such a view is now a null one, which
draws nothing instead of removing the device, and says so once.

A DirectStorage stream shorter than the block it fills left the destination's
tail holding whatever the block held before, and reported success: a reused
block keeps -1 in the bytes the title later reads. The remainder is zeroed.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A shader that chases a pointer encodes where the pointer lives in its root-SRV
register as ((dword + 1) << 8) | slot, and the draw looked that value up in the
title's root array, where it can only miss: the parameter was never set and the
shader read through an unset root descriptor. The two dwords at that location
are now read as the pointer and the pointed buffer is bound at it, which is what
the shader crate's own harness does.

A texture copied into a buffer left the buffer in whatever state it had, and a
buffer that ran as indirect arguments is left in UNORDERED_ACCESS, where a copy
into it is an invalid transition. It is moved to COPY_DEST first.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The encoder stores ((dword + 1) << 8) | slot, so subtracting 256 removes its
+ 1 and the high half is the dword itself; adding one read the pointer's high
half as the low one and composed a garbage address. The kind each null view
lost is also logged separately now, rather than only the first of the two.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The view-permission gate turns an RTV or DSV of a resource created without the
matching flag into a null view, and a clear through a null view is the invalid
call the operation check named. The console's NV12 and B4G4R4A4 textures are
both render targets and UAVs, which PC D3D12 refuses, so their host copies lose
the permission: there is nothing to clear, and the clear is skipped.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: views need their resource's permission, and a chased pointer binds its buffer
An address the code builds on top of a Constants root parameter's first
qword is the pointer the title stores there: root arguments arrive in
user SGPRs and have no memory behind them, so a global access through
the qword, or a scalar read that reaches past the parameter's own
dwords, is reaching through that pointer. The host binds a root view at
its value and the terms the program added apply to what it points at.

compute-6f6a359d1166bb27 and its siblings stop on
'a descriptor's address or format read as data' now instead of on the
address itself.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A buffer descriptor the program built around a root parameter or a
pointer reaches the host as a raw view, which has no structure to scale
an element index by: the emitter computes the element's byte offset
from the descriptor's stride instead of asking for a structured handle
the root view cannot be.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A descriptor dword with no host value now says which one the code
wanted (base address, high address, format), so the next agent knows
where to work instead of seeing one message for three gaps.

A scalar load whose address is the constants parameter's own first
qword still reads the root arguments: only an address with something
added is a pointer.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
ds_bpermute_b32 reads the source of the lane its byte address names and
reads 0 where its address has bit 0 set; it was the only DS operation a
compute program in the dump sets still used that the emitter did not
lower.

docs/compute-gaps.md records every remaining refusal with the
instruction and what would remove it, measured on both dump sets.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A program can use any even dword pair of a Constants parameter as a
64-bit address, not only the first: the code tests such a value for
zero and loads through it, which root arguments never are. The address
now names the pointer's own dword, so reads of the root arguments
themselves keep their dword offset too.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- 59 of the 64 trace programs and the irradiance-cache shading program
  translate; 51 programs leave the approximate wave64 forms.
- The workspace passes the lint with warnings as errors in both feature sets;
  a few style lints are let through in Cargo.toml for this fork.
- README status updated (relay and in-place memory results);
  docs/fork-ray-tracing.md describes what the title does and what is built.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A run could be green with the device tests having asserted nothing: they
return early without a host GPU, and nothing in the output said so. The
device is made once per process, so one guard test settles it for all of
them — if it is present there, it was present for every early return that
could have been taken — and it now fails when it is absent unless
VICTORY_TESTS_ALLOW_NO_GPU says that is intended. The snapshot tests report
their skip through the same helper, so a deviceless run names them.

The copies-per-frame line is built by a function now, and a test reads it:
it fails if the two halves of a shader-written buffer's cost, the bytes kept
before a submission and the bytes compared after it, are ever reported as one
number again.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Shaders: compute translation — root-argument pointers, raw root views, ds_bpermute
GPU: a green suite says whether it asserted anything, and the copy line cannot merge its two halves
The invariant, the three changes in shadow.rs, the extra memcpy it costs, the
three tests it needs, and the A/B that proves it — so it can be done in one
pass when a world frame survives, rather than half-landed now.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
docs: the once-per-frame range declaration, written out to land in one piece
Co-authored-by: ZazaJr24 <[email protected]>
Binding a root view at a console address that is not 16-byte aligned is the
invalid call the README records for the root UAV path, and the chased pointer
is a value the title can set to anything. It is left unbound with a once-log,
which costs the draw but not the device. The copy comment also stops claiming
D3D12 ignores a buffer's state: this host's hardware tolerates it, which is a
narrower statement and the one that holds.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A root view the title sets itself was binding at 4 and 8 bytes before this
guard existed; only the chased pointer holds a value the title can set to
anything, so only that one is refused when it is off 16 bytes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
An explicit transition does not decay: the indirect path leaves its argument
buffer in UNORDERED_ACCESS, and D3D12 names COPY_DEST for a copy's destination.
A barrier therefore has to say what it moves the buffer out of, and guessing
that is worse than not emitting one. Shadow keeps the last transitioned state,
the indirect path records both of its moves, and the texture-to-buffer copy
moves the buffer from the recorded state.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Rebasing the remembered-state change onto main put it beside a clamp
test that still called bound and done with the old signatures, so the
suite stopped compiling while the diff stayed clean.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- Shader tests: a software adapter given as the default device is not taken
  for a hardware device, so the tests that need a real card skip there.
- Diagnostics: the stencil plane of dumped depth-stencil targets and the
  title's descriptions of its stencil views.
- README: the newest commits lose the GPU device shortly after start on the
  test machine; the cause is not found yet.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
GPU: remember a buffer's state, so a copy names the state it leaves
The console compiler moves an SGPR through a VGPR lane and reads it back
at a constant lane, which is how pixel-ee41ebc3eb3fbbdc feeds a
descriptor offset. The read back is that scalar in any stage, with no
wave read, so lower::valu_op resolves it through the same
spilled_value/spilled_in_vgpr pair the lane-mask spill already uses.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
DXIL allows the wave-size attribute only on compute and node shaders, so
every mesh program - all of them wave64 - emitted a module the validator
rejects with "WaveSize only allowed on compute or node shaders", and the
container's PSV0 lane counts disagreed with the module once the attribute
was gone. Neither is emitted for a mesh stage now; the two chunks measured
validate 448 of 450 and 427 of 427 mesh programs, and the host still
creates their pipelines (translate --pipelines: 1 validated, 1 pipelines).
A mesh program therefore cannot ask for the console's wave, which is why a
lane mask read as data stays refused for mesh.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The two mesh programs that never emit in d010 are resource-layer refusals
(05276/05278, a descriptor read only as data), not validation failures, so
the claim is now "every emitted mesh program validates" with the two named.
The doc also records why dropping the wave-size claim cannot change a mesh
result (mesh lanes come from the flat thread index, cross_lane refuses every
cross-lane op in mesh, compute keeps its declaration), the packed-half
diagnosis (the console's column count is in dwords, so halves 4-7 of a row
are unnamed rather than absent), and the barycentric one (the phi resolves to
a v_mul of the barycentric, so the shader computes its own weights).

The spill test now asserts the lane the write set resolves, a lane it never
reached refuses, and a different constant is a different module.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
All 167 programs write v0/v1 with an ordinary instruction, scanned from the
disassembly of each, so no agreement walk resolves any of them; the clobber is
on one arm of a branch (four s_cbranch_execz jumps past it), so the same
attribute is interpolated twice and only one is an interpolation.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The console counts a 16-bit pixel element's columns in 32-bit registers, not
halves: c005/11190 interpolates six halves of an element declared cols 4, and
the same file fills row 4 with two 32-bit elements by column. So a packed
attribute is 2*cols halves over ceil(cols/2) register rows, which is a
signature-model change on both sides of the vertex/pixel pair rather than a
width in packed_half, and it needs a run to verify.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Shaders: a mesh shader declares no wave size, and a pixel scalar spilled through a VGPR lane
Two instruments for the failures that name nothing on the CPU side.

VICTORY_D3D12_VALIDATE=1 submits one list at a time and asks the device for
its removal reason after each, so the first submission that comes back
removed is logged with the newest operations of its list: a guilty list of
tens instead of a frame of thousands.

VICTORY_INDIRECT_RECORD=1 logs what each indirect execution reads — kind,
stride, count, the words, the thread count they name, and whether the range
fits its buffer — and declares the range for copy-back, so the next read of
it is what the GPU really holds rather than a stale mirror.

Alongside them, two buffer states stop being guessed: the clamp moves its
argument buffer out of COPY_DEST into UNORDERED_ACCESS before its UAV touch
and records INDIRECT_ARGUMENT, and a texture-to-buffer copy restores the
buffer's pre-copy state instead of leaving it in COPY_DEST.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A compute pipeline refused with E_INVALIDARG and created by a later attempt at
the same module is not a verdict on the module, so the refusal and the creation
now log the same four fields — bytecode length, root signature presence, node
mask and flags — and the two attempts can be compared instead of guessed at.

VICTORY_SERIAL_PIPELINES=1 creates compute pipelines one at a time, which
separates a driver race from a description we build differently each attempt.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The update moved the particle light-atlas compute programs to a form that
puts group barriers inside branches and loops; a dispatch of them stood on
the card until the device was reset. That form is now off unless
VICTORY_WAVE_WIDE=1, and the shader cache key includes the wave switches.
Checked with a plain run of this tree on the test machine.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Hosted runners list a display stub first, so the default device there is the
software adapter; the tests that need a real card now skip it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
505 compute pipeline creations refused with E_INVALIDARG and 505 retries
refused the same way, on a device whose removal reason was S_OK, at the
first attempt for each module: the refusal is deterministic per module in
this process, so it is not a race (serialised creation changes nothing), not
timing (a one-millisecond retry never succeeds) and not a faulted device.

The refusal line now carries the bytecode length, root signature presence,
node mask, flags, the device's reason, the attempt ordinal and whether the
module was ever created before, so the next run compares a refused attempt
with a created one instead of guessing.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: bisect submissions, read indirect records, and make a refused pipeline diagnosable
The indirect-record reader declared its argument range for copy-back on every
sampled execution, which is real work on a frame with thousands of them; the
words it prints are the host copy as uploaded, so the declaration is dropped
and the README says what the reader does and does not do.

The submission bisection serialises what the queue used to overlap, so a
removal that needs two lists in flight will not reproduce under it; its README
row now says so, and the shadow::words doc block is back above the function it
describes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: the record reader copies nothing back, and the switches say their costs
attempts() and made_once() each held their own static map, so the created count
in the first was never written: made_before read 0 for every module, including
ones created earlier in the same run, and attempt counted refusals rather than
attempts. One map behind record() counts both.

The retry also now takes the one-at-a-time guard, which it had been dropping
before, so VICTORY_SERIAL_PIPELINES serialises the whole creation path rather
than only its first attempt.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: one attempt map, so a created module is not reported as never created
A named mutex taken in main before the title runs, created inheritable so
every child of the session inherits it and an orphaned child still blocks the
next launch. A second process finds it taken, prints who holds it (pid and
image name, from a process snapshot) and exits non-zero without touching the
GPU. Released on drop, on panic and on Ctrl-C alike, because the system closes
a process's handles.

The name is Global\ where the process may create a global object and Localotherwise: SeCreateGlobalPrivilege is not granted to ordinary interactive
users, and a guard that silently fails to be made would be worse than none, so
a failure to make it refuses the run rather than continuing unguarded.

Children recognise VICTORY_SESSION_INHERITED, set once in main before any
thread exists, and hold their inherited handle instead of refusing themselves
against their own parent.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The process list the refusal prints matched any image whose name contained
"victory", which includes the renamed shader-worker children a session
starts; they are not sessions. It now matches our own image exactly, and the
wording no longer claims the listed pid holds the object, which names no
process at all.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A pid with a live parent is a session someone is driving: wait for it. One
whose parent is gone is what a crash or a restart leaves: ending it is safe,
and it is not running a title. The two need opposite reactions, so the refusal
now tells them apart instead of listing live processes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The process list was the wrong instrument twice over: it matched offline
translations as sessions, and it guessed liveness from a parent pid, which
would call a detached session a corpse and invite an agent to kill a live
title. Both are gone. The session publishes its own pid in a session-local
mapping beside the mutex, and the refusal reads that, so it names the holder
the holder named. The mapping is Local because a global one needs
SeCreateGlobalPrivilege that a global mutex does not, and a failure to publish
is reported rather than silent: the mutex alone is the exclusion.

Only a run takes the object, so a translation, an inspect or a census is never
refused, and the harness checks match run in the command line rather than the
image name.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Adopts fxceless/victory-gta6 (7b0f736, GPL-3.0-or-later) as the base of this
line. Both trees descend from upstream VIctory `ffe310e` (Marvisak/VIctory),
which is the merge base, so this is a real three-way merge and keeps both
histories: 68 commits of ours, 6 of theirs.

What this brings, from their tree: meshlet culling reading its scene buffers
as the right view kind; per-draw descriptor tables that cannot run out; the
light packed by compute read back through real copies at every mip and layer;
the fog, shadow-mask, hair, blend-shape and fire material programs; gathers at
a named mip reading that mip; implicit-level samples outside pixel shaders no
longer producing invalid DXIL; depth and stencil twins for compute-written
depth; texture read-backs; the relay and late-wait submission; title buffers
kept in card memory; in-place title memory; the pipeline library mapped rather
than read; and the ray-tracing scaffold.

Resolution: every one of the 24 conflicting files takes their side
(`checkout --theirs`), because their rendering code is what we are adopting.
`victory-hle/src/modules/{xmem,dstorage}.rs` also take their side: our page
window called `victory_gpu::unmap_title_view`, which their title-memory model
(an in-place graphics heap) has no equivalent of.

Dropped here and re-applied as separate commits next, so the mapping stays
auditable: the optimized clear value; the view permission gate; remembered
buffer state; the chased-pointer decode; the collector and retry diagnostics;
the DirectStorage short-stream tail zeroing; the compute-descriptor work; the
mesh wave-size stamp (their tree already sets a wave size for compute only,
which is the same outcome, so it needs no re-application); and the test gates.

Co-authored-by: Capy <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The merge kept our copy of the row beside theirs, which is unreachable but
says the merge was not read. Their tree already maps console element 28 to
host 23, so the table is theirs exactly.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: a second title session is impossible in code, not in a rule
Brings the session guard (PR #14) onto the adoption branch without flattening
the adoption merge: both the fxceless/victory-gta6 history and ours stay in
the graph.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Two of our test files do not survive the adoption and should not:

`descriptor/raw_view_tests.rs` exercises our descriptor heap by name
(`entry_words`, `alias_base`, `stride_table`, `release_with`), and their tree
replaces that machinery with the SLOT_MEMORY title-memory directory. It cannot
compile and it tests an implementation the merged base no longer has, so it is
removed rather than ported.

`emit/diff_tests.rs` keeps our case but reads `root_srvs` as `u16`, which is
how that test builds its register list.

Serial suite on this head: 23 `test result: ok`, 490 passed, 0 failed,
0 ignored-but-failing, under `--test-threads=1`.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Adopt fxceless/victory-gta6 as the base: the world and the opening cutscene render
Every number names the tree, the adapter and whether the run was in the
menus or the world; the offline counts say they are offline. Attribution
covers upstream VIctory, xcl as a reference only, and fxceless/victory-gta6
as the base, with what came from each. The switches are grouped by what you
would reach for and each was checked against the code that reads it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The five dumped frames' depth target has one unique value, zero, at every
one — verified here, not taken on trust. The colour target moves, with frame
1,295's present nearly flat while its second colour target still holds
structure, which the earlier summary did not say.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The mesh refusal count is a lane soak whose log is not here; the no-host-texture
count is a handoff; the base's numbers are the base's; the crash offsets are
from the crew's record, not the log on disk. The cutscene numbers are measured
here. Naming that is the difference between a document and an advertisement.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
README: what this is, whose work it stands on, and what is verified
The offset word of an offset sample is decoded inside the derivative-sample arm,
which outside a pixel stage is unreachable: image_sample_o/_cl and the bias
family return a level-zero sampleLevel before it. A compute or mesh program
that samples with an offset therefore emitted a level-zero read with the
offsets dropped, which validates, creates a pipeline, and samples the wrong
texel.

The decode block moves above the opcode match, so every visited sample takes
it. The pixel path loses nothing — the block was already inside its arm and
decodes exactly as before — and the non-pixel path gains offsets it never had.

Measured: every emitted program of chunk c010 dumped on both arms of this
change, byte compared; exactly one differs, and it is a Cs program
(chunks/c010/21672). The other 1761 are byte identical, which is the pixel path
being untouched.

cargo test --workspace -- --test-threads=1: rc=0, 23 test result: ok.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
(cherry picked from commit d001ecd721ab0cfb5fc9f5810bd758779e7822b0)
The adopted tree's copy still carries the reading this doc has since disproved:
that a 16-bit pixel element's cols counts 32-bit registers. The measured ISG1 of
c005/11190 shows neither reading covers what the program reads, so the entry now
says so, with the rows named.

Also adds the three negatives on 015832d72477fb26 (not its SFI0 declaration, not
a stage-illegal dx.op, not its entry properties) and the lane-mask join finding:
all five refusals join a value no instruction writes, and the paired-mask
accessor does not find them either.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
(cherry picked from commit f0efbba9282e253588cdbad5f74e90b48effc447)
- Clean-up passes over each translated module (VICTORY_SHADER_OPT bits: dead
  code, folding, reuse, branch facts, loads within a block, wave64 first-lane
  exchange), part of the shader cache key. About 43 % fewer host instructions
  over the pack; about 20 ms less GPU time per frame on the test machine.
- translate: a census of the emitted code.
- Checked with plain game runs of this tree on the test machine.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The dump-set table is gone: it counted 112 programs out of the title's 26,084
and misled two lanes. The corpus numbers put compute at 2,457 of 2,611 emitted,
and the refusal families are now ordered by what they cost.

New: what the opening cutscene actually requested in a 1,024-frame session —
442 programs, all of which emit here, with the three compute it binds every
frame extracting and validating. Its only failures are 505 compute PSOs
refused at creation with E_INVALIDARG, which is the host's gap, not the
emitter's.

Corrected: the pointer family no longer claims the dwords are read from a
buffer's contents. They come out of the root descriptor table
(compute-190fbf0ebe040169: s_load_dwordx16 s[8:23], s[2:3], 0x18), so it is the
same missing capability as the descriptor-dword family one step further along.
A refusal line is a failed attempt, not an absent pipeline.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Five programs, all compute (2,452 -> 2,457 of 2,611), from the two LDS refusals
going away. The dump sets made it look like six of twenty-nine; over the title's
26,084 programs it is five, and saying so is cheaper than being believed twice.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Same corpus, same command, three trees: e3dac6e before PR #5, our branch with it,
and eb6d3a3 the adopted base. Vertex and pixel 13,022 -> 14,140 of 14,247,
compute 2,457 -> 2,663 of 2,682, mesh 8,381 -> 8,762 of 8,765, refusals 2,029
-> 324.

The adopted translator raises I/O for programs ours refuses earlier, so the
denominators are not the same and the table says so. What is left there is
ranked, and 195 geometry programs on "an address in an SGPR that is no root
parameter" are the largest emitter gap on the new base.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The adoption took the other tree's victory-gpu where the two conflicted, so the
indirect-record reader went with it: nothing in crates/victory-gpu mentioned
VICTORY_INDIRECT_RECORD at eb6d3a3.

This puts the reader back, with the Shadow::words accessor it reads through: the
words an indirect execution is about to run, the count and thread count they
name, and whether their range fits its buffer. Diagnostics builds only.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
execute_indirect refreshes its argument range first, and that refresh uploads the
host copy over the GPU buffer: a record a compute pass in the same list already
wrote is replaced by whatever the host copy last held, and the clamp then reports
zero groups for a dispatch it was handed real ones.

VICTORY_NO_ARGS_REFRESH=1 skips the upload, so the clamp's own counters, taken
from the GPU, separate a title that wrote nothing from a copy that overwrote what
it wrote. Diagnostics builds only.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The pacing contract is that a frame's origin poll (which this title makes
time out and still takes the frame's token from) and its blocking flip wait
both end on that frame's own tick. The existing test bounds a flip above —
never faster than the clock — and leaves the other side open, which is the
side a halving sits on: two ticks a frame presents exactly half the rate the
title asked for while the token keeps counting one frame per flip, so the
caption, the token log and an audio capture all agree the run is fine.

`a_frames_origin_and_flip_share_a_tick` closes it: 8 frames at the 33.333 ms
interval the boot movie asks for must not take 16 intervals. Checked against
a deliberately doubled clock, where it reports "8 frames took 16 intervals"
and fails.

docs/media-playback.md writes down the instruments that separate "the title
asked for 15", "we presented 15 of 30" and "30 presents of 15 images" — the
presented-frame tokens, consecutive captured frames, the process-loopback
WAV, and the per-frame cost line — with the numbers they gave on 5728350,
e3dac6e, 991cff7 (diag and release), 187d156 with a cold shader cache and
b77a938: the boot movie at 30 fps, one image per present, audio at
corr 1.0000 and 0.3 LSB against the known-good build. It also records the
11-15 fps GPU-cost mode in today's logs (56-66 ms on the GPU per movie frame)
and the trap that makes a host with a 15.6 ms sleep granularity halve a
title asking for a shorter interval than that.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Shaders: decode a sample's immediate offsets for every stage, not just pixel
GPU: read indirect records on the merged base, and an experiment for the argument upload
GPU: a frame's two waits take one tick, so a halving cannot hide in the clock
docs/compute-gaps: the corpus measurement behind the adoption, and the three-way table
Their one commit past what we adopted (7b0f736), merged on top of our current
main so the merge commit sits on a real base. Both histories kept; the merge
base is still upstream `ffe310e`.

Brings: clean-up passes over each translated module behind `VICTORY_SHADER_OPT`
bits (dead code, folding, reuse, branch facts, loads within a block, wave64
first-lane exchange), part of the shader cache key, measured by their author at
about 43 % fewer host instructions over the pack and about 20 ms less GPU time
per frame; a census of the emitted code from `translate`; and a test that needs
a card skipping when there is none.

Taken from each side: every code file is **theirs**, because their commit is the
change being adopted and it applies cleanly to the files our merge already took
from them. `README.md` is **ours**: their edit was a status tweak to their own
fork's front page ("2 to 4" -> "2.5 to 4" fps plus two speed bullets), and our
README is the document this fork ships. Their two substantive facts -- the
clean-up passes with their switch names and their own measurement, and the
census -- are carried into our attribution table rather than lost with their
file.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Adopt fxceless/victory-gta6 1684989: clean-up passes over every translated module
Skipping the argument upload is not an option to turn on: that copy is the only
path a title-written record has to the GPU, so with it off every mesh dispatch
asks for zero groups. Measured on the card, keyed, 120 s: 102 of 102 summary
lines at zero groups against 11,879 groups a frame with the copy in place.

A footgun in main with no label is how a later lane concludes the world
dispatches nothing, which is the wrong conclusion a menu-phase log produced
tonight. The switch's own doc, the call site and the README row now all say it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A run that is killed, or whose machine goes away mid-session, left its log cut
at whatever the writer still held. The operations before a device removal are
exactly the ones lost that way, which is the account of a removal we keep
needing and not having.

VICTORY_LOG_FLUSH=1 flushes after each event; the watchdog wrapper sets it by
default, so every run it starts is readable up to its last real line.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The console compiler parks a wave64 lane mask in two lanes of a spare VGPR
and may restore the halves with other instructions between the two
v_readlane_b32. The pair restore now looks ahead in the block (nothing between
may touch the second register, write the first, or save into the lanes), so
the mask comes back as a mask. This lets indirect_light_probes
CS_IrradianceCache_Shade / ShadeSecondary translate: they were dropped every
frame, leaving the irradiance cache unlit and everything in shadow black.

An M0-relative read (v_movrels_b32) names every VGPR from its base up, which
marked the parking VGPR as an ordinary one and turned unspilling off for the
whole program. Relative reads no longer count there (relative writes still
do). billboard_nobump CS_RaytracingResolve_a56bfb9c translates with it.

translate: VICTORY_TRANSLATE_ONLY=<hash prefixes> limits a run to those
containers; VICTORY_HOST_MAX_WAVE=32 translates as on a 32-lane host, so
--pipelines matches what the runtime creates on NVIDIA.

Co-authored-by: Claude Opus 5.5 <[email protected]>
VICTORY_NO_ARGS_REFRESH skips the upload that is the only path a title-written
record has to the GPU, so any value in that variable — including an empty one
inherited from a wrapper's environment — makes every indirect dispatch in the
world read whatever the host copy last held, with no log line and no refusal.

It answered a real question and the answer was no, so it stays as a diagnostics
probe and a release build now cannot reach it: the check is behind
cfg!(feature = "diagnostics"), and a test pins that a release build ignores the
variable whatever its environment says.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: the argument-upload probe cannot be reached from a release build
Every row of the status table now says which tree measured it and whether it is
verified at b3b8533, superseded by the adoption, or unverified. The crew's fix
table gains a column for what the tree actually contains, because the adoption
merge resolved the GPU files in the base's favour and six of the nine rows are
no longer in it — marked, not deleted. Three switches are marked not in this
tree for the same reason.

Two findings: the host's argument upload is the only path the title's records
take to an indirect dispatch (102 of 102 summaries read zero groups with it
skipped against 11,879 in the control), so VICTORY_NO_ARGS_REFRESH is a probe
and never a setting; and a frame on the adopted base costs one lock — 99.2 % of
its texture time is a wait for title memory to stop being remapped, at 46 ms/MB
against 0.59 ms/MB for copies. docs/host-cost.md carries the lock with the log
lines.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A row marked No is a re-application that has not happened, not a fix that never
worked; the measurement beside it stands on the tree that produced it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The argument-upload probe is unreachable from a release build after PR #21, and
its row now says so. One VICTORY_LOG_FLUSH row instead of two, in the process
group where it belongs, without the claim that a wrapper sets it — no wrapper in
the run harness does.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A short DirectStorage stream filling its destination, and a descriptor dword
keeping a stand-in when only resource ops read it, are ours and are not in the
adopted tree; the first is the only true member of the -1 family we know of.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Comments, documents and descriptions now say "the title". No code changes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The goal is now a playable version, so a frame count without a stage reads as
progress it is not. The file names the seven stages, the one-line report format,
and the fact that the layer emits no stage line at all — so a stage claim rests
on a capture, and a slow advance cannot be told from a stall.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
docs: every claim marked against b3b8533, and the night's two findings
The device refuses a clear value on a resource without a render target or
depth flag, and the creation fails with it: the texture never exists, and
every pass that drew into it draws nothing. The description's derivation
moves into `host_texture_desc`, which also says whether the value can come
along, and a value that cannot is dropped with a warning instead of costing
the texture.

Measured on WARP: a 64x64 RGBA8 texture with no flag and a clear value is
refused by `CreateCommittedResource` as it stands, and exists once the value
is dropped.

Re-applies da15b5b, whose two files the adoption took from fxceless
(`resource.rs` 925/1762 lines divergent against its base).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The device removes itself for a view of a resource created without the
matching flag, and a clear through that view is the call that names it: the
console allows a view the host does not. `clears_render_target` and
`clears_depth` answer whether the host copy can take the view at all, the
two clear sites consult them and skip the clear, and the refusals count into
`resource::REFUSED_TARGETS` beside the descriptor path's `REFUSED_VIEWS`, so
"views and clears of a resource without its permission" is a number off the
per-frame log instead of a device removal.

`once_render` stays closed as carried over: `descriptor/host.rs::fits`
already says once per (unordered, format, flags) which texture view the host
will not make.

Re-applies 55856fb's host predicates and clear gates. Its null-view
substitution (9f1b8fb) is deliberately not re-applied: a null view needs a
description to stand for the missing one, and creating one without removes
the device (measured on WARP: DXGI_ERROR_INVALID_CALL, 0x887A0001), so the
gate live where the invalid call actually is.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Restore the clear-value and clear-permission gates the adoption dropped
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Guard: a new session object with no inheritable handle, and keys that press the stand-in pad in release
VICTORY_PIPELINE_TIMING=1 (diagnostics builds) prints, once a second: pipelines
made and refused per second, and per pipeline the whole make, the queue wait,
the translation work, the wait for another thread's translation, the root
signature, the library's load attempt, the driver's create and the store back;
with the queue depth, the worker count, their busy share and what the queue
would take to drain at the rate measured.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A world pipeline takes 2.7 s of the driver's time to make (measured: 85 % of
its making; translation is 19 %, queue wait and store nothing), while a
frame's whole pipeline budget is 500 ms. Every world frame spent the whole
500 ms of it and completed no pipeline with it: the draws were dropped
whatever the wait did.

So a wait is now taken only when the pipeline's typical make is at most
twice what is left of the frame's budget -- a menu's 30 ms pipeline is still
waited for, a world stage with seconds to go is not. VICTORY_PIPELINE_WAIT_BY_DURATION=0
waits as before.

VICTORY_PIPELINE_WORKERS sets the worker count (default: half the logical
processors, 2 to 8); the driver compiles across threads, so the loading
phase's rate is that count times 1/(create time).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A pipeline refused on one attempt and created on a later one at the same
module is not a verdict on the module, so both the refusal and the creation
now log what the description carried — bytecode length, root signature
presence, node mask and flags — and the two attempts can be compared instead
of guessed at. The compute path also honours `VICTORY_SERIAL_PIPELINES=1`,
which creates compute pipelines one at a time: that separates a driver race
from a description we build differently each attempt.

Measured on WARP, so the fields mean something: a compute description with an
empty `CS` is refused by the device, so `cs_bytes = 0` on a refusal names an
empty bytecode rather than a module the driver dislikes
(`a_compute_pipeline_with_no_bytecode_is_refused`).

Re-applies 925a98d's instrument. The per-frame lines already report 906-1,201
pipelines unmade for a whole world run, and this is how they are told apart.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Diagnose a pipeline refusal: what its description carried, and one-at-a-time creation
Pipelines: where a host pipeline's seconds go, and a frame that stops waiting for one that cannot arrive
DXIL carries one interpolation mode per signature row. The console packs
freely, so two families failed validation on rows the console built:
`SV_IsFrontFace` in the free component of a `TEXCOORD` row (112 rows
across the sampled chunks), and rows mixing an integer with a float
component.

A system value now moves to a row of its own, after the last row in use,
before the program is lowered so its reads follow it; user semantics keep
their register and mode. Reads settle an element's mode during lowering,
so the row is unified on the finished signature: an integer-and-float row
takes constant, and a mixed-mode row takes the mode the stage
interpolates with.

Measured with `victory translate <chunk> --validate`, base d780080:
  c010  1272 -> 1297 of 1319 emitted validated
  d020   246 ->  247 of 265
  d022   497 ->  498 of 500
Every other validator family is unchanged in count.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
`mask_dword` refused a mask holding lanes outside EXEC where it is written
unless two exchanging host waves could promise every lane runs that block.
A host wave that is the console wave needs no such promise: a ballot in
the block that writes the mask sees exactly the lanes the compare wrote,
the ones outside this block included.

Measured with `victory translate --validate`, base d780080: both runtime
dump sets now emit and validate in full, 112 of 112 (58 of 58 in
`failed-shaders`, 54 of 54 in `failed-shaders-after-session`), the one a
real frame requested and we refused among them
(`compute-a53a7977fe762268`). `c010` compute 443 -> 445 of 448 emitted
validated; no other family's count moved.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
shader: one interpolation mode per signature row; a lane mask read as data without an exchange
A wait skipped because the pipeline takes longer to make than the frame has
budget left leaves no trace, so a draw that was never waited for reads
exactly like one that timed out. The first eight skips of a run are logged
with the pipeline's shaders, the typical make and what was left of the
budget; every skip is counted, and the per-second timing line carries the
count.

VICTORY_PIPELINE_WAIT_BY_DURATION=0 already turns the duration rule off
entirely, so a control pass and a VICTORY_PIPELINE_WAIT_MS=0 pass differ by
the budget alone.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A copy refreshed at two addresses far apart had one span asked about, which
walked every page between them for writes that could not be there: the
adopted tree's bill at world dispatch, 856 MB checked a frame to cover 236 MB
of refreshes. ask_once now receives the refreshed ranges themselves, and
ask_ahead clusters them by AHEAD_GAP (a kernel call's worth of walking) in one
place, clusters(), whose test pins two distant ranges to two runs and a
duplicate to one.

Also corrects the guard's comment on inherited(): the handle is not
inheritable, so what holds the object is the parent, and a child that outlives
its parent is unguarded - the tradeoff taken to escape the corpse handle.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
watch: ask about the ranges a submission refreshes, not the span that covers them
Pipelines: a skipped wait is logged and counted
VICTORY_PASS_COST=1 charges each submission's wall time to the pipeline set its
lists bound and logs the worst six once a second of accounted time, each with its
share. It also logs the wall clock between submissions and the share the passes
account for: a ranked list that covers a tenth of the frame and reads as the whole
story is worse than no list, and when the remainder is large that is the finding.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The vendor compiler can fault on the fallback that runs when the pipeline
library does not hold a pipeline, and a fault there leaves nothing behind: the
trail that says which pipeline was being made is written after the call. This
one is written before it, with the library's own refusal reason, so the next
fault names its pipeline instead of needing a symbol resolved from a stack.

VICTORY_NO_PIPELINE_FALLBACK=1 (diagnostics only) refuses that pipeline instead
of making it: a refusal leaves a draw missing, a fault kills the run.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
pass_cost was called per submission with the whole list slice and added that one
submission's time to every list's key, so a world submission entered its own time
once per list: the ranking measured how many lists a set appears in, and the
accounted share read in the hundreds of percent.

Now the submission's distinct sets are collected first and its time is split
between them, so it enters the map once. The line also says "since start" in its
doc and its message, because the map accumulates rather than decaying: a reader
who took it as this second would draw the wrong conclusion from a long run.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: charge a frame's time to the passes that spent it
GPU: name the pipeline the library missed before the compiler sees it
Two refinements from review of the pass-cost row.

A submission's time was split evenly between its distinct pipeline sets, so ten
lists on one set and one on another read as fifty-fifty: a set that dominates a
frame was under-charged exactly in proportion to how much of the frame it is. The
charge is now proportional to the number of lists each set had, which is the unit
of work actually submitted.

And the first call of a run has no wall clock between submissions, so the accounted
share was computed against a span of one microsecond and read ~100 % for a frame
nobody had measured. No span now means no line.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GPU: charge a pass set by its share of the submission's lists
Three commits from our sibling, both histories kept:

- `3930989` Fix mesh pipeline test on unsupported GPUs (#14) — their test-only fix;
  taken whole.
- `90228a7` Shaders: restore parked lane-mask pairs a few instructions apart;
  relative VGPR reads keep parked lanes (#11) — the lane-mask family that was the
  last refusal on a real frame's path.
- `4e17478` The game is no longer named in the tree — their documentation rename.

Conflicts, two files:
- `README.md`: ours. The README is maintained by this crew and its attribution
  table is keyed to our branches.
- `crates/victory-hle/src/modules/gameinput.rs`: ours. Their side re-adds
  `#[cfg(feature = "diagnostics")]` around the key-to-pad merge that lane C
  deliberately moved out of diagnostics so a release build presses the pad too;
  taking theirs would silently re-open the release-build press gap.

Measured on the runtime dump set the title actually asked for
(`victory.exe translate <dump> --validate`): **3 of 4 compute programs emit and
validate**, and the one that does not is `b22a16a178976e1b`, a partial-wave
16-bit wave sum that cannot be reproduced bit-exactly (DGR-4's read, not a
missing gate). So `90228a7` closes the lane-mask family on our own dumps rather
than only in their test suite.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Adopt fxceless main (3930989, 90228a7, 4e17478): the lane-mask family, a mesh test fix, and the rename
VICTORY_SERIAL_PIPELINES=1 guarded one branch: the compute create in
pipeline/host.rs. The graphics branch, the mesh stream and four lazy create
sites (the argument clamp, the in-place copy, the plane pass, the card
compare) entered the vendor's compiler beside it, so serialising could only
have made the amdxc64 fault rarer rather than absent.

One guard now (pipeline::compiler), held by library::pipeline -- so a
pipeline's load, create and store -- and by those four sites. With the
switch off it returns None and takes nothing.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
VICTORY_PIPELINE_WAIT_BY_DURATION=1 now turns the skip on; the default is the
full-budget wait it replaced. A skip drops the draw, and a dropped draw is
missing geometry: a run of #26's default rendered a cutscene black.

The measurement stands (every world frame spent its whole 500 ms budget
waiting for stages that take 2.7 s and completed no pipeline with it) and the
conclusion drawn from it was wrong to ship as a default. What replaces it has
to keep the draw and drop the wait: a pipeline made before the frame asks for
it, not a frame that gives up on it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
WARP runs and card runs share one cache folder and one library file, and a
pipeline library blob is keyed to the adapter: the host refuses the other's
with D3D12_ERROR_ADAPTER_NOT_FOUND, 'the blob provided does not match the
adapter that the device was created on' (0x887E0001). Ten of those in one
night's logs; after each, open() started an empty library and every load was
a miss, which is the '0 served, 313 refused with E_INVALIDARG' reading --
E_INVALIDARG from Load*Pipeline is D3D12's not-found, not a broken contract.

The library's file now names its adapter kind (host-pipelines.bin for the
card, host-pipelines-warp.bin on the software adapter), so neither clobbers
the other, and a rejected blob is renamed aside and named in the log instead
of being overwritten by this run's save.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Pipelines: the wait skip is opt-in, the serial switch covers every compiler path, and the library is per adapter
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Record every host pipeline the title asks for, as a line a library can be built from
A run whose frames are nearly all pipeline construction charges less than a
second of submission time in its whole life and reports nothing, which reads
as unmeasured on the frames worth asking about. The threshold is now a switch
and the default is unchanged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
pass cost: let a short run set its emit threshold
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
victory precompile: build the pipeline library from a dump instead of a title run
A fault inside the driver leaves no line of its own, so what a create was
given is unrecoverable after the fact. VICTORY_PIPELINE_ARGS=1 logs the
description's numbers immediately before CreateComputePipelineState: the
bytecode length, the root signature blob's length, the root parameter,
descriptor table and static sampler counts, whether a root signature is
bound, and the node mask.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
StorePipeline's error was dropped, so a library that refuses every entry
looked the same as one that fills: the file stayed small while thousands of
pipelines were made, and each later run compiled them again.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
pipeline: log a compute create's arguments before the call
library: say when a store is refused, and count them on the save line
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
victory precompile: replay the dump on several workers, so the world's 1,950 fit in a slot
Three verdicts changed with the new base: the clear value, the view-permission
gate and VICTORY_SERIAL_PIPELINES are back in the tree; the instruments lose
their not-in-this-tree mark one at a time as they return. The pointer chase is
still absent, and the base's own answer to the same problem is now named beside
it so nobody reads the two designs as interchangeable.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
VICTORY_PIPELINE_WAIT_BY_DURATION is now opt-in and off by default because the
draw a skipped wait drops is the picture; it had blacked a whole cutscene. The
row says that, so nobody sets it as a speed-up. VICTORY_PIPELINE_TIMING joins
the table with its five stages named, and VICTORY_SERIAL_PIPELINES now covers
every path into the vendor's compiler rather than compute alone.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The cutscene row reported 2,240 frames of one card window as if it described
the build. The fault under it is intermittent, so the row now says what it is:
what that window reached.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
An external keystroke reached the title's own device state as virtual_keys=[13]
(Enter, pad A) and the caption changed in the same run. Every press before it
carried vk=0 because the harness never set the key code in its SendInput
structure — the caveat a reader reproducing this needs.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
VICTORY_NO_PIPELINE_FALLBACK refuses what the library missed instead of handing
it to a compiler that has faulted there; that trades draws for the run. The row
carries the window it produced (151 s, frame 1,539, 0 faults, 4,561 of 4,894
draws) and says the stage is not named in that report.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The command builds the pipeline library by replaying a dump, which means a
device and a compile, so it is separated from the offline list rather than
appended to it. VICTORY_PIPELINE_DUMP and VICTORY_SHADER_SAVE are what it
reads; VICTORY_PIPELINE_ARGS logs what a create was handed before the call,
which is the only account a fault inside the vendor compiler leaves.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The console creates sgaWindowClass and puts our caption on it, so WM_KEYDOWN
reaches the console's window procedure and never the host's; six presses landed
with focus proven and keys::down saw nothing (measured 2026-11-24, with
windows-of.ps1 naming the window). WH_KEYBOARD_LL sits in front of every window,
so an injected key and a person's key now take one route into the same held set
- the property the pad fix exists to keep.

It reads only while the foreground window belongs to this process, releases
everything when the foreground leaves (an alt-tab must not leave a key held into
the next run), is dropped with its thread (UnhookWindowsHookEx on Drop), and
records whether the install succeeded, since a hook that silently failed is the
whole reason a press can land and read as nothing.

Tests: a_key_is_taken_only_while_the_foreground_is_this_process (our pid taken,
another's dropped, no foreground dropped) and the existing held-set test.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The install was on the window thread, which a build that never creates a host
window never reaches: a 17-second run with four presses had no install line at
all. It now gets a thread whose only job is its message loop, installed once
with the shader cache before the title runs and dropped with the run.

The first proof of the path: six hook events and, for the first time, the
game's own  a millisecond after a press
and  after the next, in a run that then died at 6 s
at amdxc64+0x85fd0f. The event line stays: it cost a night to learn that a
press can land, prove focus, and still carry vk=0 to the hook, so the vk code
is now logged with the event.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
docs: the fix table re-checked at 082a618
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
input: a low-level keyboard hook, because the title's window is not ours
The WARP repro for the compiler fault dies in compute_pipeline_with and
leaves one line of output. VICTORY_PIPELINE_ARGS=1 now logs the bytecode
length, the DXIL container's first bytes, whether a root signature is bound
and the node mask immediately before the call, so the repro says what it
handed the compiler.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
emit: log the shader host's compute create arguments
Pipelines: draw a made pipeline as a load, and declare only the heaps the code indexes
The install result was logged only under diagnostics, so a release build whose
hook failed lost every key press - a person's included - silently, which is the
same shape as the empty capture folder and the vk=0 press: a failure that looks
like a working system. The failure is now a warn! outside the cfg.

A key held while the foreground leaves by mouse stays held, because no further
key event arrives to clear it: held_keys() now empties the set when the
foreground is not this process's, so a bot holding A while the person alt-tabs
does not come back with A still down.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
input: a hook that fails to install says so in release, and a stuck key cannot survive an alt-tab
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
precompile: claim each line once (F18), and write the dump under its lock in one call
The replay's report counted makes, which cannot answer whether a name the next
boot asks for is in the library. Each line whose pipeline is on the cache's
early-pipelines.txt is now counted, and of those, the ones the library served,
so a replay ends with 'held N of M replayed' against the list the title itself
writes.

The per-threshold save and the save after the last line are back too: the flag
was left unused and a finished run kept its tail only in memory. translate and
precompile now report a crash the way a title run does, so a create that faults
inside the driver names its frame instead of an exit code.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
precompile: report coverage of the title's early list, and save what the last batch stored
The title's movies are decoded by the Bink 2 decoder it ships, so its imports
are its own code and the frame buffers are the only place to look from. With
VICTORY_BINK_TRACE=1, five of that DLL's 23 imports are wrapped on the
import-resolution path -- never a module serving bink2scarlett.dll by name,
which is the frame-2 death -- and each says: the structure
BinkGetFrameBuffersInfo is handed, the structure BinkRegisterFrameBuffers
registers (raw words, so a refused or missized registration is visible), every
committed pointer in it with its pitch, height and size, and at every
BinkDoFrameAsyncWait whether those buffers still hold what they held, read at
both addresses when a texture turns out to be a second view of them.

The texture side then says, for a texture whose memory is one of those
buffers, what its refresh decided: write-watch says unwritten, guarded view
with no write seen and not its hash turn, left out as uploaded before, or
uploaded from title memory. Nothing is wrapped and no line is written without
the switch, so a run without it binds exactly what it did before.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Instrument the movie surface: the decoder's buffers and the texture path's decision
VICTORY_SHADER_SAVE wrote a container from inside the shader's translation, so a
container existed only for a shader some frame actually compiled. With the
pipeline fallback off most requests are skipped before translation: one 150 s
dump names 19,105 distinct programs and only 2,860 were saved, which leaves
victory precompile able to replay 5,270 of its 83,555 lines. The container is
what comes in, not what comes out, so it is written where it enters the process,
once each, and the .dxil stays with the translation.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
shader save: keep the container of every shader the title hands us
VICTORY_MOVIE_DUMP=<frame>:<folder> writes the staging buffer's bytes — the
detiled title memory the host texture is copied from — for every texture
sampled at that presented frame, one file per texture memory. With a capture
of the same frame that answers what the counters cannot: does the picture on
screen hold the decoder's current frame, or bytes from somewhere else?

Answer on 28cccf7, frame 500, sha256 da40d0ba20e18d30…: the dumped 3840x2160
R8 luma plane and the captured picture agree at correlation 0.9998 and the
same mean luma (81.9), and they agree again two frames later while the
neighbouring frames correlate 0.9364 — a period of three, which is the
decoder's three registered frame buffers. So the quad is fed from that plane,
through this upload path.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Dump what a movie texture is uploaded from, at one named frame
The wait trace had no frame number, so a stretch where the picture stopped
could not be read against a window's frames. On 0e8c88d, frames 602-662: 41
waits, every one reading 0 % change in luma and chroma, against 5-7 % at
every wait before frame 599 — while the title kept calling BinkNextFrame. The
picture held because the decoder produced nothing, not because nobody
re-read the plane.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Say which frame each decoder wait came in
A title's movie is decoded into 64 KiB-page frame buffers that the decoder
writes through the console's view of them, while the movie's R8 textures read
a second view of the same pages. Neither detector sees those writes:
GetWriteWatch fails on 64 KiB-page memory, and the page guard is per virtual
page, so a write through the other view never faults on this one. The only
detector left was the content hash, taken one frame in eight per texture.

The runtime records every mapping the title makes — 127 view entries an end
for a luma plane, 34 for a chroma plane, section 3464, 64 KiB a slice — so a
texture whose bytes another view maps is now known (inplace::another_view, by
section bytes, asked once per texture) and is hashed at every refresh. Every
other texture keeps the eight-frame turn.

Measured on 8a4cb10, the same window before and after, hardware, keyed:

  before: texture uploads 0 recorded, 4 left out; 1.6 MB hashed, 1.6 MB changed
  after:  texture uploads 3 recorded, 1 left out; 12.7 MB hashed, 12.7 MB changed

12.7 MB is the movie's three planes exactly (8,294,400 + 2,211,840 x 2), so
the surface now takes the decoder's frame every frame it is presented. In the
captures the picture is still only where the decoder is idle: luma changed
2-10 % at every wait to frame 615 and 0 % from 618, and the capture series
goes 1.4, 1.2, 0.9, 0.6 then 0.0 over those same frames.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Hash a texture at every refresh when another view maps its bytes
The replay counted makes, and the pipeline's own `name` is its shaders' debug
string, not the library's key, so the coverage line could only ever read zero.
HostPipeline now carries the key the library stored under, and the report counts
against it.

VICTORY_ASKED_NAMES=<file> (one name per line, from a boot's own 'the library did
not hold it' lines) turns that into demand coverage: 'asked set H held of N
replayed', and a line whose name is not on the list is skipped before its driver
compile, so a replay bounded by demand costs minutes instead of hours.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
precompile: measure and replay the set a session actually asks for
A create sometimes ends the process inside amdxc64.dll+0x85fd0f, and it is the
module that decides it: one dump line naming compute:a1266cc7391ae0d6 faults on
the first create of a fresh process, while thousands of others create in the same
process. The pipelines behind the black frame at 1354 are exactly that class -
1,886 programs that cannot be created at all - so no library can cover them and a
boot that meets their creates dies.

victory poison probes each module in a child process (it never creates anything
itself, so a fault costs one child) and writes the ones whose child died.
HostPipeline::new consults the list before the create and refuses, dropping those
draws with a counted, once-per-module log line instead of the session.

The list is keyed by build (this executable's hash) and by adapter: an entry is a
statement about the DXIL one build emits, and a list from another build is
ignored rather than obeyed.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
pipeline: refuse the modules the driver's compiler faults on
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
VICTORY_DXIL_OVERRIDE=<hash>=<path>[,<hash>=<path>] replaces one module's
translated DXIL with a file, leaving the root signature and graphics state built
from the container alone. A fault inside the driver's compiler cannot be caught in
the process, so a candidate module is judged by the same four-second create that
faults today, while the description it is judged in stays the real one.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Say why a texture's refresh goes past the guard, in bytes
pipeline: run a candidate DXIL module in place of a container's translation
A poison list is a statement about one build's DXIL — the runtime obeys
only the list whose `build` matches the hash of its own executable. Two
silences hung off that:

- The prober overwrote whatever list was already at `--out`. A run of a
  different build then replaced a working list with one that build's own
  binary can never honour, and the next boot read a list and refused
  nothing. It now refuses to overwrite a list written for another build
  and names both keys.
- The runtime said nothing when the list was absent, so a list in the
  wrong directory (the prober's default `--out` is the shaders directory,
  the runtime reads the pipeline cache) looked exactly like a build with
  no faults. Both the absent and the mismatched list now log their path.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
poison: a list says which build it was written for, and says so out loud
Ported from upstream 86a5ed6 (Marvisak/VIctory) onto this fork's
descriptor path, keeping its `raw_window` handling.

A host buffer view counts its first element from its buffer's start; a
console view starts at any address. Where a structured view sat at a ring
position inside the title's heap — off an element boundary of the copy it
found — it was refused and its slot read zeros. The world does this: the
run at 22:58 logged `buffer view not on an element of its host copy
offset=1811360 element=12`, and control.log the 32-byte UAV form.

`shadow::for_view` keeps `find`'s copy where the view does start on an
element, and otherwise makes a copy of exactly the view's bytes, held by
address and length with the least recently asked for dropped past 1024 so
a per-frame ring position does not grow without bound.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
gpu: a view off its buffer's element boundary reads a copy of its own
The compute-pipeline create dies inside AMD's compiler on a module we
emit from some of the title's largest programs: `0xc0000005` at
`amdxc64.dll+0x85fd0f`, `rcx = 0`, read of `[rcx+8]`, reproducibly, in
4 seconds, offline on `22319.dxbc` and on every module the poison probe
had found. The module validates; it is the create.

Bisecting `VICTORY_SHADER_OPT` over the pass bits gives it exactly: the
`REUSE` bit alone (`4`) faults, every other bit alone is clean, and all
the passes without `REUSE` (`59`) is clean where all of them (`63`, the
default) faults. So the fault is not in the game's code but in an
optimization of it.

`REUSE` was commoning calls for the same arguments, and that included
`createHandle` / `createHandleFromBinding` / `createHandleFromHeap` and
`annotateHandle`. A handle is an identity rather than a value: the
annotation that follows it gives it its resource type, so the two are
not interchangeable with another handle carrying the same index. On
`22319` the pass removes 471 of 924 creates and 454 of 924 annotations,
and 17 handles end up sharing an annotation that carries another
handle's type. Skipping either half alone happens to compile; the pair
is what has to stay intact.

`NEVER_COMMON` excludes those four callees from the pass. The
reproduction creates a pipeline where it used to fault 5/5, at +4.5 % of
module size (364,356 B -> 380,712 B; disabling `REUSE` outright is
419,752 B). `VICTORY_REUSE_SKIP=<dx.op name>,...` is the knob for
finding the next one.

`VICTORY_SHADER_CENSUS_OPS=<file>` writes the fine form of the census:
every `dx.op` a module calls, by the callee's name, which is how the two
faulting modules' constructs were compared with the clean ones'.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Shaders: a resource handle is an identity, so REUSE never commons one
`#59` fixed one misclassification: `REUSE` commoned `createHandle*` and
`annotateHandle`, which are pure by their attribute but not values, and
AMD's compiler faults when a handle loses its own annotation's type. The
question that fix leaves is whether anything else in the class is
misclassified too.

`VICTORY_SHADER_CENSUS_OPS` now writes each callee with the class
`Effect` gives it (`P` pure, `R` reads, `L` lanes, `W` writes), so the
audit is a table rather than an argument: only `P` can be merged or
dropped by a pass, `R`/`L` are reused within a block with every write
clearing the table, and `W` is never touched. Over the 130 containers in
`D:\victory-scratch\top-big-dir` the whole `P` class is

  annotateHandle, createHandleFromBinding, createHandleFromHeap,
  binary.f32, binary.i32, cbufferLoadLegacy.i32,
  flattenedThreadIdInGroup.i32, getDimensions, groupId.i32,
  legacyF16ToF32, legacyF32ToF16, tertiary.f32, threadIdInGroup.i32,
  unary.f32, unary.i32, unaryBits.i32

— the three handle operations that carry an identity, already excluded
from the pass, and thirteen that are a function of their arguments
alone. So no other callee needs the rule, and `Effect::Pure`'s doc now
says what puts a callee in it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
`StorePipeline` refused 36 of 2,019 replayed pipelines with
`E_INVALIDARG (0x80070057)`, and the warning was printed once per
process, so the log could not say whether they are compute, mesh or
vertex+pixel. The class decides where to look: mesh state, pixel state,
or the compute path's root signature.

The warning is now said once per class, and the save line carries the
three counts beside the total.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A pipeline is loaded where it is first asked for, which in the world is
inside a frame: that draw is dropped and the next frames carry the load
or the compile. The boot that saw the dark onset dropped 1,586 draws
that way.

With `VICTORY_PRELOAD=1` a run writes a manifest beside its library —
the dump lines for exactly the keys the early list holds, with each
stage's container beside them — and a later run loads them at startup:
load only, never a create, so a pipeline this machine's library does not
hold costs a counted miss instead of a driver compile inside a frame.
Bounded to five seconds, and the line says what it did:

  preloaded N of M, missing K   (with `cut` for what the budget cut)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Shaders: the census says which class a pass gave each callee, so the rule can be audited
library: say which class of pipeline the store refuses
preload: load an earlier run's pipelines before the first frame asks
Ported from upstream bacb06a (Marvisak/VIctory) onto this fork's
descriptor path.

A copy a view made for itself (`for_view`'s own bytes) was cached by
(start, length) in a map capped at 1,024 entries, so after a thousand
other views' copies the entry was dropped and the same bytes made a
second copy: the slot still showed the first, and the refreshes went to
the second, which no draw read. The map now holds weak references —
an entry lives exactly as long as a heap slot or a list holds the copy —
and is pruned of dead entries when it grows past twice its last pruned
size, instead of dropping one that is still shown.

`Kept` carries the copy with the resource, so a slot keeps alive what it
shows and lets it go when the slot is rewritten or nulled.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
GitHub reported this branch CONFLICTING against 141a657 while 141a657 is
its direct parent and a local merge of the two is clean; a new head makes
it recompute.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Hash a second view at every refresh only where the decoder writes it
A boot with `VICTORY_PRELOAD=1` read `preloaded 638 of 641, missing 3,
cut=1959, ms=6327`: asked + cut = 641 + 1,959 = 2,600, exactly the
manifest's line count, so nothing was missing — the pass stopped at
BUDGET_MS and left 1,959 pipelines to the frames that ask for them.

The budget is now `VICTORY_PRELOAD_MS` (default 5,000, clamped to 60,000
so a typo cannot make a first frame wait forever), and the line still
says what it cut: how long a full pass takes depends on the manifest and
the machine, and only a run can say which.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
preload: the startup budget is a switch, not a constant
Making `VICTORY_PIPELINE_WAIT_BY_DURATION` the default was proposed again
on the arithmetic — 500 ms of a 642 ms frame spent waiting on a 1,693-deep
queue whose makes take 2.7 s — and the arithmetic is right about the
frame rate and wrong about the picture. The code already carries the
countermeasurement from 4b2d7bc: a skipped wait drops the draw, and a run
where the skip was the default rendered a cutscene black.

A slow frame is a complaint; a black frame is a defect. The test pins the
default so the next reader meets that argument at the switch instead of
redrawing it from a log.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
pipeline: pin the wait skip as opt-in, with the measurement that made it so
Four shaders in the acceptance boot refused to translate with a named
limit each. Two of the limits are these.

**A wave sum of 16-bit floats where not every lane runs.** The console
sums a wave with a step-by-step buddy tree, and reading a partner lane
was refused whenever the mask left one out — the lane has no partial to
read. Its identity is what the console's own `v_cndmask` put in that
lane, so the ballot's bit for the partner now stands the identity in for
the read. That is the sum over the lanes that run, in the console's own
order, and it is the same identity the console uses. `b22a16a178976e1b`
emits and validates at host waves of 64 and 32; it refused at both.

**`v_permlanex16_b32` outside a whole-wave section.** `wave.rs` models
it inside such a section; the title's pixel shaders also reach it as an
ordinary instruction, where it is a lane read at a computed console lane
(the other row of this lane's half, at the lane the selection's nibble
picks). `v_readlane_b32` already lowers a lane read against one, two or
half host waves, so that body became `read_console_lane` and both
instructions use it. `a929109552ce1e84` emits and validates at host
waves of 64 and 32; with the new arm renamed out of the match it refuses
at `0xd00` again, so the arm is what carries it.

Still refused, and a separate row: `a descriptor read only as data`
(`7d0f14ce44746d7e` at `0x5204`, `6b6db9f1a526daeb` at `0x49dc`) — one
site, two sub-cases: a descriptor whose dwords are read only as bits
with no resource use behind them, and a sampler's dwords read as data.
Both need the image size fields rebuilt from `dx.op.getDimensions` on a
dynamically picked handle instead of read out of descriptor memory.

`cargo test --workspace -- --test-threads=1` under
`VICTORY_D3D12_WARP=1`: 23 targets, 530 passed, 0 failed.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Shaders: a divergent 16-bit wave sum and a permlane outside a section
The refresh path needs the decoder's plane table to know which textures are
the movie's own buffers, so the table and the wrappers that fill it are now
on every run, and VICTORY_HASH_MOVIE_ONLY=0 brings back the old rule that
hashed every texture another view maps at every refresh.

The reports stay behind VICTORY_BINK_TRACE=1: the per-wait sample reads
192 KiB of the title's memory and writes a line, and the plane registration
was one line per plane. VICTORY_BINK_TRACE=0 wraps nothing.

The offset between a texture's address and the decoder's is now found in
every build (movie::surface), not only in diagnostics ones, because a
release binary that cannot match the movie's buffers would hash them on the
eight-frame turn instead.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The frame line accounts for submitting and the copy line for the recording
threads' list calls; at 2,731 draws a frame and 3,554.9 ms a frame, 2,152 ms
was in neither. VICTORY_PHASE=1 times the parts that were missing - a draw
inside a command-list call, binding inside the draw, the shadow and
address-space lookups wherever they run, the queue's loop around a
submission - and prints them a second, beside the frame line, with what is
left over named as the title's own threads.

Off by default: the switch is read once, and a span that is not timing costs
one atomic load.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Print where a frame's time goes, where the counters leave a gap
The console compiler works a size out of a descriptor it picks from a heap at an index
held once per draw, and never passes that descriptor to an image instruction: no leaf of
any descriptor names the load, and nothing reads its dwords except the arithmetic that
divides by the size. `descriptor_data` refused those loads, so five pixel shaders of the
deferred G-buffer pass never translated.

A load whose address carries a dynamic term is one heap slot resolved at bind, the same
way every sampled descriptor is, so the host can name the resource the index selects.
Take its dimensions from the host view and write them in the GFX10 layout, as the sampled
case already does.

A load whose index the host cannot name at bind — a fixed table address — is not one of
these and keeps refusing: an association that quietly yields zero draws the wrong surface,
which is worse than drawing none.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The phase line reported 0.33-0.49 ms of binding on every draw and could not
say which part of it. Binding now carries three phases of its own - the
heaps, root signature and pipeline state; the descriptor tables a shader's
bindings are written into; the root constants, views and unordered views -
so a window names the part that pays.

Measured on the world window, 6,362 draws and 1,351.8 ms a frame: 932.9 ms
binding, of it 4.3 ms of state, 648.6 ms of descriptor tables, 269.5 ms of
root views and constants. The state is free; the tables are 70 % of it, at
0.10 ms a draw.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
gpu: a heap slot holds its view's own copy
Hash a movie's own buffers by default, and record them without the trace
shader: answer a heap descriptor's sizes from the view its index selects
Split the bind: descriptor tables are the wall inside a draw
The phase line says binding is 0.70 ms of a draw and the tables are most of
it. This counts the tables a draw asks for, the ones the list already holds
with the same contents (a hash hit: nothing copied), the ones made, and the
slots hashed and copied for them with their time - so the next window says
whether the title re-binds the same ranges (then a skip is the fix) or its
contents change every draw (then the copy is the fix).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The counters said the fresh tables a draw asks for are mostly made (9,172 of
14,978) while a hash of their contents costs 3.7 ms a frame and the copy
247.2 ms - so the rest of the tables' time in the phase line is in building
the fresh list and bringing the other entries up to date. Both are counted
now, so a window splits a draw's table work into its three parts.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The table counters took the enum from 80 variants to 82 while the array
stayed at a literal 80, and the first window that incremented one of the new
counters aborted the title ('index out of bounds: the len is 80 but the index
is 80'). The length now comes from the last variant, so adding a counter
cannot index past the array again.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Splitting the table work left 0.063 ms a draw in the copy of 20,034 slots
into dynamic ones. That copy is a driver call per slot, so this counts what
each slot made - constant buffer, resource, unordered, sampler, other - and
what the call cost, to say which kind is the 3.5 us and whether its inputs
are cacheable.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A descriptor the driver makes costs 11.3 us and the world asks for 33,799 to
47,484 of them a frame, most of which are the same views again: 70 % are
copies of a descriptor this frame already holds. The cache is keyed on the
whole view description, cleared every frame so a resource freed and another
made at its address cannot be shown a stale entry, holds what the slot shows
so a hit keeps the resource alive as a miss does, and VICTORY_VIEW_CACHE=0
makes every descriptor the driver's again.

Measured, same base and conditions: 380.6 ms a frame for 33,799 descriptors
(11.3 us each) without the cache, 279.7 ms for 47,484 (5.9 us each, 33,325
of them copies) with it - about 255 ms a frame at that descriptor count.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Make a host descriptor once a frame, then copy its 32 bytes
The acceptance boot on the person's launcher path at e106502, keys pressed,
150 s, cache on against cache off in the same conditions:

  cache on   20k-48k descriptors a frame, 70 % of them copies:  8.6-14.1 us each
  cache off  42k-126k descriptors a frame, every one made:      2.5-7.4 us each

So the driver's call is cheap (3.5-7 us) and this frame-cache's lock, map
lookup and 32-byte copy cost more than it saves. #72's number came from
comparing two different windows, not two costs of the same work.

The code stays behind VICTORY_VIEW_CACHE=1 for anyone who wants to measure
it; off is the driver's path, which is today's behaviour.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Make the view cache opt-in: on the real path it costs more than it saves
Answers the question the descriptor row turned on: the placed class asks for
10,234-22,292 views a frame and 6,754-14,861 of them were already asked for
in the same frame (57-67 %), so a frame does re-bind the same placed views.
Constant buffers are few and small: 806 asked as 383 distinct ranges, 0.1 MB
to stage each distinct range once at 256 bytes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
World window: 1,812-5,272 fresh tables a frame, 19,262-41,134 slots copied,
and every one of them because it holds a constant buffer. The heap-size
reason never fired, so the per-draw rebuild is entirely the 16-to-256
alignment conversion.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
VICTORY_TABLE_KEY=1 hashes each fresh table's resolved contents - the bytes
of every constant range, the host identity and description of every view, the
slot order, the heap and the extent - and counts the distinct keys a frame
makes, then recounts with one field left out at a time.

A world window of 4,119 fresh tables keeps 4,119 distinct keys: the title's
per-draw table instances are all different from each other, so a resolved key
has nothing to merge and the descriptor count is the title's demand. Leaving
the heap out merges 253, leaving the host identity out merges 3,064, and
using a constant buffer's address instead of its bytes merges 1,828 - every
one of those a wrong picture, which is what the sensitivity count is for.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Count what a descriptor cache, a staging arena and a resolved key would each save
Slots 0x1c8 and 0x218 take a description and an interface id, and the
gameplay run calls them thousands of times. The interface is answered
here rather than guessed: both call sites load the id from the title's
own `.rdata` (title+0x1061e06b8, `lea 0x3d6915a(%rip)` at
title+0x2477557), and it reads
`{765A30F3-F624-4C6F-A828-ACE948622445}` — `ID3D12PipelineState`.

The warning now says that, reads 256 bytes of the description instead of
128, and names which of its first words point at shader bytecode
(`DXBC`/`DXIL`/`SHDR`). A console description whose shaders we can find
is one we can make; without that, the log says only that something was
asked for.

Co-authored-by: BED <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:46:47 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:37 UTC · original · edited 2026-11-25 16:49 UTC

Automated triage for the maintainers.

Needs rebase. The new head still does not merge cleanly into current main (67e8ae14). Conflicting files: README.md, apps/victory/src/main.rs, apps/victory/src/run.rs, apps/victory/src/shader.rs, apps/victory/src/translate.rs, crates/victory-gpu/Cargo.toml, crates/victory-gpu/src/capture.rs, crates/victory-gpu/src/copystat.rs and 42 more.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1861#issuecomment-7149761298) · edited 2026-11-25 16:49 UTC <!-- victory-triage v1 head=c5383d064873d23125f753e841dd1e3d9e58bc7f verdict=needs-rebase at=2026-11-25T16:47:20Z --> Automated triage for the maintainers. **Needs rebase.** The new head still does not merge cleanly into current `main` (67e8ae14). Conflicting files: `README.md`, `apps/victory/src/main.rs`, `apps/victory/src/run.rs`, `apps/victory/src/shader.rs`, `apps/victory/src/translate.rs`, `crates/victory-gpu/Cargo.toml`, `crates/victory-gpu/src/capture.rs`, `crates/victory-gpu/src/copystat.rs` and 42 more. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • README.md
  • apps/victory/src/main.rs
  • apps/victory/src/run.rs
  • apps/victory/src/shader.rs
  • apps/victory/src/translate.rs
  • crates/victory-gpu/Cargo.toml
  • crates/victory-gpu/src/capture.rs
  • crates/victory-gpu/src/copystat.rs
  • crates/victory-gpu/src/descriptor.rs
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/device.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/fence.rs
  • crates/victory-gpu/src/frame.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/indirect.rs
  • crates/victory-gpu/src/lib.rs
  • crates/victory-gpu/src/list.rs
  • crates/victory-gpu/src/memory.rs
  • crates/victory-gpu/src/pipeline.rs
  • crates/victory-gpu/src/pipeline/host.rs
  • crates/victory-gpu/src/pipeline/library.rs
  • crates/victory-gpu/src/pipeline/make.rs
  • crates/victory-gpu/src/primitive.rs
  • crates/victory-gpu/src/queue.rs
  • crates/victory-gpu/src/resource.rs
  • crates/victory-gpu/src/shader_cache.rs
  • crates/victory-gpu/src/shadow.rs
  • crates/victory-gpu/src/texture.rs
  • crates/victory-gpu/src/watch.rs
  • crates/victory-hle/src/modules/audio.rs
  • crates/victory-hle/src/modules/dstorage.rs
  • crates/victory-hle/src/modules/gameinput.rs
  • crates/victory-hle/src/modules/xmem.rs
  • crates/victory-loader/Cargo.toml
  • crates/victory-shader/src/emit/bitcode.rs
  • crates/victory-shader/src/emit/container.rs
  • crates/victory-shader/src/emit/diff_tests.rs
  • crates/victory-shader/src/emit/host.rs
  • crates/victory-shader/src/emit/lower.rs
  • crates/victory-shader/src/emit/mod.rs
  • crates/victory-shader/src/emit/rect.rs
  • crates/victory-shader/src/emit/shader.rs
  • crates/victory-shader/src/emit/valu_tests.rs
  • crates/victory-shader/src/emit/waterfall_tests.rs
  • crates/victory-shader/src/emit/wave.rs
  • crates/victory-shader/src/io.rs
  • crates/victory-shader/src/ir.rs
  • crates/victory-shader/src/native.rs
  • crates/victory-shader/src/resource.rs
  • crates/victory-shader/src/structure.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1861/head:github-bot/gh-1861'
git switch 'github-bot/gh-1861'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1861'
git switch 'github-bot/gh-1861'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1861'
git switch 'github-bot/gh-1861'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1861'
git switch 'main'
git merge --squash 'github-bot/gh-1861'
git switch 'main'
git merge --ff-only 'github-bot/gh-1861'
git switch 'main'
git merge 'github-bot/gh-1861'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1861
No description provided.