Build: AVX2 codegen and fat LTO for the CPU-bound layer #649

Open
github-bot wants to merge 1 commit from github-bot/gh-649 into main AGit
Owner

@⁠StarSparkleNova on GitHub · 2026-11-27 16:26 UTC · original
StarSparkleNova:perf/frame-time-pass → main · +14 −2 · 2 files · 1 commits · open

Rebased onto current main (the original branch was based on a commit no longer in main's history, so it showed the whole repo changed; now 2 files).

Build-only, no behaviour change:

  • .cargo/config.toml: target-cpu=x86-64-v3 (AVX2) for the Windows targets. The layer is CPU-bound (per-frame shadow compare, land dword merges, descriptor scans) and was built for baseline SSE2. v3 = AVX2 (Alder Lake has it, not AVX-512).
  • Cargo.toml: lto = fat (was thin, #96).

Compile-verified on x86_64-pc-windows-gnu (default + --features diagnostics). Not runtime-tested (no Windows/RX 7900 hardware).

**@⁠StarSparkleNova** on GitHub · 2026-11-27 16:26 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/649) `StarSparkleNova:perf/frame-time-pass` → `main` · +14 −2 · 2 files · 1 commits · open Rebased onto current main (the original branch was based on a commit no longer in main's history, so it showed the whole repo changed; now 2 files). Build-only, no behaviour change: - .cargo/config.toml: target-cpu=x86-64-v3 (AVX2) for the Windows targets. The layer is CPU-bound (per-frame shadow compare, land dword merges, descriptor scans) and was built for baseline SSE2. v3 = AVX2 (Alder Lake has it, not AVX-512). - Cargo.toml: lto = fat (was thin, #96). Compile-verified on x86_64-pc-windows-gnu (default + --features diagnostics). Not runtime-tested (no Windows/RX 7900 hardware).
A descriptor picked without a branch, as the compiler does when it
hoists both loads (invariant memory) and turns the if/else into a
select, reaches the resource instruction through s_cselect_b64 per half
(or s_cselect_b32 / s_cmov per dword). None of its dwords is then a
load, so tracking stopped with "a descriptor neither loaded nor built"
and the whole program, and every draw using it, was dropped.

Such words are now split by the SCC value they all read: what each is
when SCC is set (S0) and when it is clear (S1, or the old destination
for s_cmov), with words not selected the same on both sides, and each
side traced on its own into a new Source::Select. Selections with
different conditions stop, and a choice that mixes two descriptors
still stops as "a descriptor changed after loading". The lowering picks
the heap index of the two loaded descriptors by SCC and creates one
heap handle, as a phi of loaded descriptors already does per edge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
A descriptor held in VGPRs is used through a waterfall loop: each pass
reads the first active lane's dwords with v_readfirstlane_b32, compares
them with every lane's own (v_cmp_eq), runs the access with the lanes
that match and repeats for the rest. Tracing stopped at the readfirstlane
results ("a descriptor neither loaded nor built").

The tracer now follows the read lanes' dwords to where each lane gets its
own: global_load_dword* from a table or heap at a per-lane address (an
image descriptor's two x4 loads lined up), or a v_cndmask_b32 choice per
lane between such sources (e.g. two s_load descriptors). Other sources
fail naming them (LDS read, buffer load, phi, input, computed VGPRs).
The loop's compares of those reads with their own dwords are recorded.

Lowering gives the access each lane's heap index (its load address over
the descriptor size, or a per-lane select of indices) with
createHandleFromHeap's nonUniformIndex set, lowers the recorded
readfirstlanes as the lane's own dword and their compares as true, so
the loop runs once with all lanes. Wave32 and wave64 are tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
The resource tally in `victory translate` matched every `Source` variant
by hand, so the new `Select`, `Fetched` and `Lanes` kinds left it
non-exhaustive and `cargo check -p victory` failed. A fetched descriptor
is counted with the loaded ones; selections and per-lane choices are
never leaves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
A descriptor read with v_readfirstlane_b32 was traced to each lane's
own dwords wherever it was, so a first-lane read outside a loop, or one
without the v_cmp_eq that hands every lane its turn, sampled for lanes
the program skipped (reported on the PR with the back edge of the
fetched waterfall test replaced by s_nop).

Now:
- a compare counts only when it and the v_readfirstlane it reads are in
  one loop (each block reaches the other);
- every descriptor read from the first lane needs each of its dwords
  compared that way, or translation stops with "a descriptor read from
  the first lane outside a waterfall loop".

Two tests cover the missing back edge and the missing compare.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
A waterfall loop whose descriptor dwords are VGPR phis stopped with "a
descriptor read from the first lane of a phi" (294 programs of the
title on #307, all at if/else joins of two s_load_dwordx4 descriptors
copied into VGPRs). An EXEC if/else leaves two phis per dword: the
flow block's joins an arm's dwords with what lanes that skipped the arm
held before (inputs, unrelated loads and arithmetic in the title), the
join after the other arm picks per path. Only lanes that never read the
descriptor bring those other values, so tracing every edge fails.

Tracing (resource::track now takes the program's per-lane form):
- per-lane phis of one block are traced on each edge into it that the
  lanes accessing the descriptor can take, from structure's lane
  conditions (new Structured::reach, the exits' conditions, and
  Bools::meet, a read-only satisfiability check); the trace starts from
  what holds in the access's block. Edges no such lane takes are None
  in the new Source::LanePhi { block, args };
- every per-lane write it follows (v_mov_b32 copies, v_cndmask_b32,
  global_load_dword*) must run in all those lanes: a guarded one fails
  with "a per-lane descriptor written where some lanes may keep the old
  one". On #307 an else arm without its s_cbranch_execz traced as the
  second descriptor for every lane;
- a loop header's phi fails with "a descriptor read from the first lane
  of a phi at a loop header", words defined after the join with "a
  descriptor partly joined by control flow"; without the per-lane form
  (structurisation failed) the join is refused.

Lowering computes each traced edge's heap index at its predecessor's end
(through lane_heap_index, so loads, per-lane loads, choices and nested
joins work), joins them with a phi (0 on untaken edges) and makes the
handle non-uniform. The waterfall compares need no change.

Tests: the if/else of two loaded image descriptors, a join of a per-lane
load and a v_cndmask choice, nested arms choosing a buffer descriptor
with lanes that skip both and do not load (pruned only by the access's
condition), a loop header phi, and an unskipped else arm. On #307's head
the three join programs fail with "...of a phi" and the unskipped arm is
traced as one descriptor for all lanes. On an RTX 5070 and WARP, each
lane reads its own arm's texture or buffer; the shaders pass dxil.dll
1.8.2502.11. Reversing the phi's inputs fails validation, flipping the
heap index fails the GPU check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commit proves that a loop's compares select the lanes of
the access and that its retry keeps exactly the lanes still waiting.
Every failure of that proof was reported with one reason. They now say
which part failed:

- the access is in no single-block loop ending in s_cbranch_execnz;
- the loop is nested in another or split over blocks;
- the compares do not select the access's lanes;
- the retry does not keep the lanes still waiting.

Without the per-lane form the proof cannot run. Nothing is emitted then,
and that failure is the one reported, as before.

Tests, all hand-assembled:

- the case ifBars reported on upstream PR #566 (the compares never
  narrow EXEC), an access under a further mask, a retry that keeps other
  lanes than those waiting, a wave64 retry of one half: refused, each
  with its reason;
- the waterfall LLVM writes for GFX10 and later (a v_cmpx_eq chain, the
  retry as todo & !EXEC, also folded into s_andn2_wrexec) is accepted in
  wave32 and wave64, and each lane samples its own texture on the GPU;
- one loop per operand, the sampler's inside the resource's, is refused
  by name. The console gives each lane its own pair there; following the
  outer loop's reads into the inner block is left for later.

Other per-lane work in a waterfall loop is still taken to run once for
each lane; marked as a shortcut.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
main moved under #307 and this branch. One conflict, in the test module of
emit/lower.rs: the imports take both sides' names (#117's `half_shift`
beside `Lowered`), and #117's `scalar_bit_tests_lower` sits after this
branch's waterfall tests. No code outside the test module was touched by
hand. A merge rather than a rebase so #307's commits keep their ids.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
main now has CI (clippy with -D warnings, then the workspace's tests) and
three new tests that call `resource::track`, which this branch gives a
fourth argument. No textual conflict, but the test target did not build:
those three calls (emit/lower.rs, twice in emit/mod.rs) now structure the
program first and pass it, as this branch's other callers do. Both of
CI's clippy commands are clean on the result.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The four tests of emit/waterfall_tests.rs each dispatch on the hardware
adapter and on WARP. Run in parallel, the test process sometimes died of
an access violation (7 of 24 runs of these four tests on an integration
branch; an image test beside a VALU test does the same on WARP). They now
take the VALU tests' lock, which moves out of `run_cases` to be shared.
With it: 340 workspace tests pass with VICTORY_WARP=1, as on a CI runner,
and the shader tests pass on the RTX 5070.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Shaders: per-lane descriptors chosen by control flow (stacked on #307)
The console compiler loops over a per-lane descriptor by reading the
first active lane's table offset (v_readfirstlane_b32), narrowing EXEC
to the lanes with the same one (v_cmpx_eq_u32), loading that entry
(s_load_dwordx8) and dropping those lanes (s_andn2_wrexec). Such a load
now goes through the waterfall proof; when it holds, each lane loads its
own entry through a non-uniform handle. Unproven, the offset stays the
first lane's, as before.

Translation census over the title's 26,096 programs: none lost, 108 get
past these loops to a later refusal. The 249 programs behind #736 also
need per-lane size queries in loops without an access.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
- 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]>
Co-authored-by: ZazaJr24 <[email protected]>
- 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]>
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]>
- 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 host removes the device for a constant buffer view of more than 65,536
bytes. The title's view heap holds larger sizes in slots it does not use,
and the size went to the host as it was.
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]>
Comments, documents and descriptions now say "the title". No code changes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: vkd3d-proton refuses such a pipeline
with E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.
The guard on view memory sees no write made through another view of the
same pages; such a change was found only by the hash every eighth frame.
The boot logo video and the loading animation write their textures that
way every frame (a ring of three): each showed up to eight frames late
and in turns, so the presented picture cycled through three, a new one
every eight frames, and flickered. The six-star screen of the first
seconds changed before the hash ever caught it.

A guarded texture is now hashed at every check for its first 64 frames,
and for 64 frames after each change the guard missed; textures that stay
unchanged go back to every eighth frame.
VICTORY_TEXTURE_HOT=0: every eighth frame only, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its programs translate and run, but on the test machine the lighting gain
could not be shown, it costs about 40 ms of GPU time per frame, and the
picture is being re-checked one change at a time from a known-good tree.
It may come back once that is settled.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The previous commit took it out; that was not wanted. The tree is again as
it was before that commit.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Every indirect execution was followed by a move of the list's clamped
arguments back to the common state, and the next clamp moved them from
common to unordered access. Drivers may treat a barrier into or out of
the common state as a full wait, so even the window path
(VICTORY_INDIRECT_WINDOW=1), whose draws skip the clamp, still recorded
one barrier between every two draws.

The list now remembers that its scratch buffer was left readable as
indirect arguments: executions read it with no barrier of their own, the
next clamp moves it straight back to unordered access, and it returns to
common once, when the list closes or a bigger buffer replaces it. The
waits for earlier shader writes around the clamp are unchanged.

Tests: two windows of executions with no barrier between them, on WARP
and through a host list; the tracked state across clamps, growth and
reset; the existing clamp tests follow the new states. With
VICTORY_D3D12_DEBUG=1 in a diagnostics build, the host-list tests also
check that the debug layer reports nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A frame's worth (3,200) of one-record indirect draws of our own, clamped
one at a time and in windows of 32, recorded with the old barriers (back
to the common state after every execution) and the new ones, timed with
GPU timestamps around the list. Ignored by default; any machine with a
GPU runs it in seconds, no title files needed:

cargo test -p victory-gpu --release --lib indirect::bench -- --ignored --nocapture

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clamp charged the list's budget record by record: an atomic read and
a compare-and-swap loop per record on one word, every thread of a window
racing for it, so a group of n records took n rounds and about n*n/2
atomics. The word is CPU-visible memory (zeroed on the CPU at
submission), so on a card of its own each of them crosses the bus. On an
RTX 5070 Ti the benchmark's windows of 32 took 46-50 ms for 3,200 draws
where draws clamped one at a time took 19 ms (#220).

Now the records' costs go to group-shared memory, one thread charges
their sum with one compare-and-swap (retried only if another group got
there first), simulating the same saturation record by record in lane
order, and every thread reads whether its record fitted. The mesh
diagnostics (largest group count asked, groups asked in all) are summed
in the group and added once. What a record costs and when it runs empty
are unchanged; which records of a group fit is now their lane order
instead of the order the GPU served the race.

Test: a group with 300 left of the budget keeps its first draw (100),
empties the second (250, which takes the rest) and the ones after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The clamp's charge per group walks the group's own records (one, for a
  record clamped alone) instead of all 64 slots.
- The host-list tests read the debug layer's messages after closing the
  list and before the submission, which moves them to the log (review).
- The benchmark lives in its own file and records five cases: what main
  records, one record at a time and in windows of 32; what this tree
  records, both ways; and windows with the new barriers but main's clamp,
  to tell the two changes apart. main's clamp is kept in the benchmark to
  measure against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two more cases, one record at a time and windows of 32, with this
tree's clamp and the budget words in a device-local buffer instead of
CPU-mapped memory: whether the clamp's atomics crossing the bus are
what a draw clamped alone still costs on a card.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clamp charges the list's budget with atomics: at least an atomic
read and a compare-and-swap in a row for every clamp, so for every
indirect execution clamped on its own. The budget was in memory the CPU
maps (zeroed on the CPU at submission), so on a card of its own each of
those crosses the bus.

Now the words live in a device-local buffer of the list. The list zeroes
it before its first clamp (WriteBufferImmediate, as a copy), the clamps
charge it as before, and when the list closes the clamp's notes on mesh
records are copied to the mapped words, where the next submission reads
them for the frame line as before. VICTORY_INDIRECT_CARD_BUDGET=0 keeps
the old place, for an A/B; lists without ID3D12GraphicsCommandList2 keep
it too.

Test: a recording whose clamps spend the whole budget, then one with a
small record after the reset, which runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An execution may ask for thousands of records with a count buffer that
counts a few: the clamp runs a group per 64 asked. Before the charge per
group, the threads past the count returned at once; with it, the first
thread of every group read the budget word, and for mesh records added
the group's notes to it, records or none. In memory the CPU maps that is
up to three atomics across the bus per empty group (on an RTX 5070 an
in-game A/B of 32c6229 ran slower, #220). Now a group without records
makes no atomic; the group's barriers stay in uniform control flow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Double-precision shader instructions (v_cvt_f32_f64, v_add_f64 sums, the
makeDouble overload name and flag), a first half of a paired interpolation
read as data, sooner eviction of idle textures and caches under memory
pressure, a retried DirectStorage destination write, the texture catch-up
budget, VICTORY_FIRSTLANE_OWN, and zlib-rs in place of miniz_oxide.

Left out: the fork's personal launcher scripts and its readme.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Every host view heap ends at a null slot that view indices past the heap
read (a host that takes large heaps gets 2^21 views; one that caps them
keeps the capped heap), the cache key includes that limit, and
v_permlane16/x16 are lowered.

Both forks lower v_cvt_f32_f64. The IEEE form with its test is the one in
use; this branch's flush-to-zero form is kept beside it, unused, and its
test is ignored until the console's float mode for the instruction is
checked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A texture a shader picks by index was uploaded once, when the title wrote
its view, and again only if the view was rewritten or the runtime told of
a remap. The title often fills the texture's memory only afterwards (its
streaming reads land later), so the host copy kept what the memory held at
the first look for the rest of the run: zeros. Which textures lost that
race changed from launch to launch; the main character's face came out
black and her hair pale in about three launches of four.

Now a texture uploaded whole is looked at again after 4, 12, 40, 120 and
400 frames (a fingerprint of 48 KiB of its memory); a changed one is
uploaded again and the looks start over. One test launch re-uploaded more
than 6,000 textures this way. VICTORY_HEAP_RECHECK=0 turns it off.

Known gap: the fingerprint samples the start, middle and end of the
memory, so a texture whose other parts arrive later is still missed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Textures and staging cut from 64 MB blocks; a kept view per page section and
page lists read again until the title has filled them in; the GPU side told
when streamed bytes land; results fetched over the copy queue
(VICTORY_RELAY_COPY=1); the write-watch journal behind a reader-writer lock;
the shader cache keyed by the translator's sources and `victory shaders`;
helper lanes as in upstream 1733 (VICTORY_HELPER_OWN).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The depth bounds test (#82 by Kaivyyy, as is): a pipeline that enables
  it is made from a DEPTH_STENCIL1 stream under its own library name, and
  the title's OMSetDepthBounds reaches the host list. Before, such draws
  passed at every depth. On the test machine (RTX 4070) the first room is
  lit by its lamp for the first time: walls, table, bunks.
- Defaults: what shaders wrote is copied back by a thread of its own
  (stage 2), wide copy-back, card copies from 1 MiB up to 1,024 MB, and
  256 lists in the air. About 230 ms a frame where it was about 400.
  Off: VICTORY_RELAY=0, VICTORY_WIDE_BACK=0, VICTORY_CARD_BUFFERS_MIN_MB=16
  VICTORY_CARD_BUFFERS_MB=512, VICTORY_LATE_WAIT_LISTS=128.
- Textures picked by index are uploaded while loading and before a draw of
  the title's decoration bake, which samples them by index and runs once
  (VICTORY_EARLY_TEXTURES_MS, VICTORY_BAKE_TEXTURES_MS; 0 turns each off).
- Placed textures are keyed without the filler words of their description:
  two views that differed only there each had a host copy
  (VICTORY_PLACED_FILLER=1 keeps the old key).
- VICTORY_TEXTURE_ROOM_PERCENT (90, unchanged) sets how full the card may
  get before textures picked by index wait.

Known: the first room's walls are still missing in some launches, and
shaded areas are too dark (the bounce light has no ray-tracing structure
to trace yet).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/main.rs
Two fixes for textures that shaders pick by index, both proven with a
slot listing before they were made:

- The title keeps only a texture's small levels and places the next
  texture in the address range of the absent large ones. Described at full
  size every neighbour overlapped, and each view written took the textures
  beside it out of the upload queue and made their host slots null (tens
  of thousands of slots a run). A newer view now makes an older one stale
  only when it starts within that one's first 4 KiB.
  VICTORY_STALE_TEXTURES=overlap: the old rule; =0: never. Unit tests on
  the span table alone. The first room is lit with its walls and the
  characters' textures in the first launch with it.
- With the card at its limit, a texture that already has its host copy is
  uploaded again when the title changed its memory (it took no new card
  memory, and was refused all the same).
  VICTORY_REUPLOAD_WHEN_FULL=0: as before.

Logging only, off unless asked for: both video memory groups and budget
moves; card accounting (VICTORY_CARD_ACCOUNTING=1); the slots a listed
draw's shaders read, with their state (VICTORY_LIST_SLOTS=); a trace for
the missing first-room walls (VICTORY_WALLS_TRACE=1 or 2). A card test of
what a bare command costs (ignored by default):
cargo test -p victory-gpu --release -- --ignored bare_command_cost --nocapture

Known: about 3 to 5 frames a second; more than half of the texture memory
on the card is held for levels the title has not loaded yet (next).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The submitting thread stood 25-30 ms a frame for one 480-byte constant
buffer and one 20 KiB buffer copy a frame whose source lies in the title's
174 MB heap, which a pass of nearly every flight is declared to write whole
(a root view has no size). With VICTORY_CARD_STEPS=1 such a constant buffer,
with =2 such a copy too, is made on the card by a list of ours in front of
the submission's lists, behind the flights; anything the argument does not
hold for waits as before. Off by default.

Diagnostics: the five waits for flights that cost most, every second, by
what waited, why it was not done on the card, the declared write and the
shaders that declare it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/indirect.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- An image or structured buffer whose descriptor is read for its size
  alone (the puddle passes, a water simulation step).
- The record count of a structured buffer is asked of the raw view the
  host makes of it: as a structured view's it was in bytes on AMD.
- Primitive-ordered pixel shading becomes rasterizer ordered views (the
  hair cards' layers).
- A 16-bit wave sum where not every lane runs, on 64-lane waves, bit for
  bit as the console's tree.
- "Some lane is left" of a mask operation as a number; scalars parked in a
  VGPR used before; a one-channel store into a counter texture (the
  upscaler).
- translate --list prints a hash of every emitted module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_LIGHT_REFRESH (on): view memory nothing wrote since the last asking
is known by a bit a block, copies nothing of which changed wake no thread,
the ends of a range are not copied at every refresh, long copies are split.
VICTORY_LAND_WINDOW=1: what shaders wrote goes into guarded title memory
through a view of ours of the section, the guard stays.
VICTORY_SEND_CHANGED=1: pages taken again go up to the card where they differ.
VICTORY_HEAP_SPREAD (on): a sixteenth of the heap's slots at every pass.
Three log lines split the preparing, the askings and the heap pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runtime maps a view and then tells the write watch. A refresh on another
thread could guard the new blocks in between, and the telling then forgot
them and left them read-only: the title's next write to one was an access
violation nobody takes. Told of a new view, the watch now gives the write
access back; before an unmapping it only forgets, as before.

The test binary's random crashes were d3d10warp.dll's own, with two tests on
the software adapter at once: they take turns now. The watch's tests forget
their guards before their memory is freed (another test's memory could get
the address and inherit them), and three more are no longer tied to other
tests' memory, the adapter's other work or a busy PC's timing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One pass clamps the arguments of all indirect executions between two
points where they may change; its jobs are in upload memory that is filled
while the list is recorded. The replayed frame: 2,355 clamps become 980
passes, 86.1 -> 77.7 ms; with VICTORY_INDIRECT_BATCH=2 133 passes,
84.6 -> 75.3 ms.

Replay: --batch-clamps, --only-buffers, --listing; --compare runs turn by
turn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The relay's thread merged some 1,500 pieces of 64 KiB (98 MB) a frame one
after the other: 45 ms in the frame's shape, of them 22 ms copying and
merging, 18 ms the kernel's faults on the first write to each page of memory
just made writable, 5 ms protection calls. Now one AVX2 pass a piece, in jobs
on four threads, through a view of ours of the title's pages that is never
guarded (VICTORY_LAND_BESIDE): 8 ms. The log splits a landing's time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer copy whose destination another step of the submission read was
refused and waited for flights (10 ms a frame in run steps-1). Copies and
fills that depend on a taken one, or it on them, are now taken too and done
level by level in the steps' order; a fill of a texture's upload buffer as
well. Reads on the CPU ahead of the copy are no reason to refuse.

The waits for title memory changed under shader writes that came up behind
it: pages of the title's constants have more changed runs than the 512 a
submission sent up (4096 with the switch), and where it still waits, it
waits for the flights that declared the range, not for everything.

Diagnostics: refusals name the kind of step, waits under shader writes their
reason and the host copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Water transmission volumes and the rest of the upscaler translate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_FETCH_CHECK=1 (off by default): with VICTORY_RELAY_COPY a piece is
fetched beside later submissions, and one of those that clears it and fills
it again with the same is not flagged by its compare: title memory and the
CPU's side kept what was in between, and the next refresh of the 64 KiB
sent it up over the right bytes. The compare now gives the piece's hash
with its flag; a fetch that is not that is made again by the next flight
that may write the piece. (The test shows 11-12 of 12 wrong without it.)

VICTORY_UPCOPY_CHECK=1 (diagnostics): at each send up, the words that the
title did not change and the card holds another value of; every few seconds
at rest, the words in which a copy's card side is not its CPU side, and
whether they were declared as written and fetched.

victory replay --upcopies: the same question of a captured frame, and which
pieces were written undeclared (replay1 and replay2: compute
82a2ad6d07417d36 through views picked by index, 73-75 pieces a frame).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/indirect.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
What is landed beside the guards is an entry of the journal, after the
bytes are in: the blocks stay guarded, clean and known by their bits.
VICTORY_LAND_WINDOW goes, VICTORY_LAND_BESIDE does its work; the runtime
tells of a section it lets go, and our view of it goes too. A test of
landings, title writes and light refreshes at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runtime maps a view and then tells the write watch. A refresh on another
thread could guard the new blocks in between, and the telling then forgot
them and left them read-only: the title's next write to one was an access
violation nobody takes. Told of a new view, the watch now gives the write
access back; before an unmapping it only forgets, as before.

The test binary's random crashes were d3d10warp.dll's own, with two tests on
the software adapter at once: they take turns now. The watch's tests forget
their guards before their memory is freed (another test's memory could get
the address and inherit them), and three more are no longer tied to other
tests' memory, the adapter's other work or a busy PC's timing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A raw UAV buffer the program loads with GLC is globally coherent on the
host (the upscaler's waits for other groups, the ped blend shapes): a
load in a loop that only waits would be made once otherwise. Ten shaders
change by it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The check of fetched pieces (VICTORY_FETCH_CHECK) with the landing pool:
pieces are gathered and ordered as there; with the check whole pieces come
down and are hashed by the job that lands them. Off, the fetch is the
landing's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title maps the pages of a batch, and fills in their page lists, in its
own submit (image +0xe88f0): first the batch's mapping list (+0xf2c470,
which writes the page lists at +0x55aa6a0), then the status entry, then
our Submit. A list is a piece of one table, a number per 64 KiB of address
range, that is only ever overwritten. Our queue submitted itself at half
its capacity (2,079 of 4,159), which the title's batches (up to 4,095)
pass three or four times a load: those requests ran up to 0.6 s before
the lists were filled in, on page 0 (waited for) or on the page numbers an
earlier mapping had left (known, so written: somebody else's memory).

- A queue submits itself only when it is full of commands nobody submitted.
  VICTORY_DSTORAGE_HALF=1: at half, as before.
- A list that changes during the write has its new pages written too.
- "page list was not filled in yet" is said (as a warning) only of lists
  that were not: nearly all of its lines were waits for the page table's
  lock.
- A read of a file the host refuses is logged and tried again, its
  destination opened again before.
- VICTORY_DSTORAGE_TRACE=1 (a line per batch, and per request something is
  wrong with), 2 (every request).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Off by default. A shader that stores through a view it picks by an index (37
compute programs of the title, 82a2ad6d07417d36 one of them) writes buffers
nobody declared. With a submission that has one, the buffers found written
that way are declared and landed as any; of the other buffers the heap shows
unordered views of 32 MB a frame are compared on the card, in turn, and one
that changed undeclared is found. Found late is not landed late.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- What the kernel is writing (file reads) is not guarded by a refresh before
  the call is done (`kernel_writing`): the read would have failed.
- A title thread that uses a page while the runtime remaps another page of
  the same view waits for that in the fault handler; it faulted on a page
  the title never gave up.
- Blocks being unmapped are not guarded again, memory the title frees leaves
  no notes of its blocks (its VirtualFree is taken over), and other memory at
  an address once guarded or absent keeps its protection.
- The second part of a submission's one asking has a number of its own.
- What shaders wrote waits for a change of mapping instead of being lost;
  what could not be written is counted and said; zeros into title memory
  that went are no fault.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_KNOWN_HOLES (on): a placeholder's holes are known until the runtime
tells of a mapping or an allocation there; other holes are asked about with
the guards' lock not held. VICTORY_LAND_TAKEN (on): a copy a landing went
through is noted as up to date with it. The split tells more of the askings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One constant used by a comparison and an ordinary sample became a
comparison sampler for both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ports of 7d04943 (a signed 64-bit operand sign-extends its literal),
645391b (a normalized buffer format's ends load as exactly 1.0 and -1.0),
40f30be (FLAT offsets ignore bit 11), 3d71ad1, 344704e, 5d6889e, 78c1267,
c3a04e2, e3fe5bf and the tests 259ba31, 8610ffb, 41b2472, 45ed8e3, 8d67fa5.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ports of 6f36cdf (normalized attributes of rectangle lists), 97c8783
(A8_UNORM is not of the R8 typeless family), b956320 (copy footprints of
depth-stencil textures), c1c3281 (the descriptor ring's wrap), e6fe8ec and
e34cb53 (CreateSamplerX bounds), 691236d (appended elements are aligned).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- All 24 workers read each file through one handle, whose reads the host
  does one after the other: 48 KiB at random from levels.rpf gave 185 MB/s
  where a handle per worker gives 990 (5 GB/s against 14 from the cache).
  VICTORY_DSTORAGE_IO=one|handles|overlapped|direct (handles).
- xmem: the title's pages by number, and where it sees them, each have a
  lock of their own, apart from the one its mapping calls hold while the
  host maps, commits and unmaps. Looking pages up, filling one and telling
  of it, 24 threads beside one that maps: 2.7 million requests a second
  for 0.57, 145,000 maps a second for 60,000. A view is noted before the
  GPU side is told of it, so that a write between the two is not missed.
- Title memory is not touched with these locks held.

Benchmarks: read_bench (VICTORY_BENCH_FILE), map_bench, both ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Memory sync:
- The guard over every view of a physical page (code by myokex, victory-amd
  c6dc4d8, after pull request #115 by Spexivus, its correction by joroyt and
  a part of VIctory #1122 by tightfall): the title shows one page at several
  addresses and a copy was guarded at one only. 0.8 to 1.0 million writes
  through another view in a five-minute run on the test machine.
  VICTORY_VIEW_GUARD=0 turns it off.
- Kernel reads into title memory are read beside and copied in (Joshua Odom,
  10ea38e).
- Writes of the storage layer into physical pages are counted where the
  title has the pages mapped and can open the guards there
  (VICTORY_PAGE_WRITES, off: counted only). Failed page-destination reads
  are retried.

Card memory:
- Levels on demand, off unless VICTORY_LEVELS_ON_DEMAND=1: a texture the
  title fills takes card memory for the levels the title holds; held levels
  get memory only while the card has room and are asked for again. Its test
  runs on the software adapter; not run on a card yet.
- Refused texture slots are held back so a pass reaches the slots behind
  them; room can be kept for card copies of title buffers (off).

Tools: translate --warm all; the shader cache is keyed on the translator's
source; counters for copy-back races, page writes and the copies the
texture sweep never lets go; a walls trace.

Game runs of these changes on an RTX 4070: five five-minute runs without a
device loss or a failed request. This merged tree was built; its test
suites were run on the tree the changes come from (gpu 129, hle 97).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pass that uploads textures picked by index asked the host for every
64 KiB of every texture it looked at, and twice for each block that was not
there (12,000 slots wait for their memory during a load, each looked at
again and again): 146 us for a texture of 22 MB, 721 us with 1 MB of it
there. The views of physical pages are known: 1.4 and 0.1 us. Memory that
is in no view is asked of the host as before. VICTORY_MAPPED_BY_VIEWS=0:
always. Measurement: cargo test --release -p victory-gpu --lib look_costs
-- --ignored --nocapture

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Blocks the kernel writes, or the runtime is unmapping, are no known holes
and not published; foreign blocks are never held; freed memory forgets its
known holes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
After each command that can change a texture, the texel under a point of
the picture is copied out; commands that changed one are named with their
pipeline and the values before and after. The listing names textures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The scan was cut to the heap's length, which left out the slots past the
cursor a run that crosses it needs; upstream's corrected test (072fde0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's tile lists are dispatches of a group per tile: in the captured frame 2dc364df5d3278b8 asks for 67,440 groups (the one before it 67,272) and 940c2635dc1312f4 for 47,760, the 115,200 tiles of 2560x1440. The clamp cut the first to 65,535: 1,905 tiles at the list's end, the lowest of the picture, did not run. Up to 2^20 groups run as asked on AMD cards (a test on the card: every group once, under its number); more still runs 65,535.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b856c46dd10bbb550157b255d113a3cca2f3f38a)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On by default. Sends to card copies were copies out of their CPU sides made
when the card came to them, and later submissions had written those by then:
of three submissions that each copy a value to the same bytes and read them,
all read the last one's (test: 12 of 12 wrong). The bytes are taken into
memory of the submission's own at preparing; short runs go as one scatter per
copy. Title buffer copies go up whether our side changed or not.

VICTORY_CARD_ALL=1 (off): every title buffer's copy has two sides, so that
this holds for the small ones too (they are written in place now, under the
submissions in the air). VICTORY_PICKED_WRITES: 1 declares, 2 lands too.

The check (VICTORY_UPCOPY_CHECK): what a submission took twice is no longer
counted as older values sent; copies of the title's out of their place in a
submission; copies held for unchanged that are not title memory's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's syncs recorded nothing on the host, which orders nothing
between dispatches by itself. The ray-tracing structure builder has no
other wait between its stages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shader that walks a structure takes its address out of the structure's
descriptor. The view has no resource, so the address came out 0 and every
ray missed. Also: only programs that store by raw address declare the
copies they reach that way as written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A view D3D12 cannot place (a raw view off 16 bytes, a structured one off
16 and off its stride, a typed one off its element) was null, and the
shader read zeros: the colour-table bakes' parameter blocks are raw views
at byte 8. Such a view now gets a copy of its own bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b2a3ce9ced69e669d2d56e20c2dca7011b7e405a)
Also: victory replay --images writes the bytes of buffers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On by default. They were all done on the CPU when their submission was
prepared, ahead of its first draw: of copy, draw, copy, draw both draws read
the second, and a source a shader writes earlier in the submission was read as
it was before. The list copies now, in the destination's host copy, out of the
source's host copy where shaders write it, else out of upload memory filled at
submission; copies into textures take what shaders wrote too. Title memory and
the reference of the host copy take the bytes at submission as before, so the
landing finds only what the card made of them.

VICTORY_WINDOWS_OWN=1 (off): windows have two sides as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fork's guard over every view of a physical page is kept on our own block
bits, known holes, kernel writes and changing blocks; what both had, ours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Descriptor records the title copies into its heap as bytes are mirrored
  before each submission (pull request #305 by Flyander, after upstream
  VIctory 86a5ed6), with a per-slot fingerprint so only records that
  changed are mirrored, the page read through the kernel, a switch
  (VICTORY_HEAP_SYNC=0) and a counter: about 40,000 records a frame on the
  test machine.
- A buffer view off its copy's elements gets a copy of its own bytes
  (after upstream 86a5ed6; VICTORY_VIEW_OWN_COPY=0: refused as before).
- Room on the card for the world's first-frame bursts: buffer copies
  (VICTORY_CARD_ROOM_FOR_BUFFERS, now on) and render targets
  (VICTORY_CARD_ROOM_FOR_TARGETS_MB, 3,072); a copy turned down gives its
  room up and is logged; the texture pass asks again every 32 MiB. 98
  buffer copies made (945 MB) where earlier runs made 1; 25 MB compared
  on the processor a frame where it was 550 to 710.
- Levels on demand: the fixes of pull request #747 by AscilCH. First run
  on a card (RTX 4070, VICTORY_LEVELS_ON_DEMAND=1): no device loss, 3.1 GB
  not allocated for levels the title does not hold. Still off by default.
- The guarded blocks under storage writes into physical pages are opened
  by default (VICTORY_PAGE_WRITES=0: counted only).
- Shaders: a program is translated with first-half interpolation pairs
  only if it was refused for one (with it on for every program 8,551
  working pixel programs came out changed); parked lane-mask pairs,
  f64 conversions and sums, lane permutations: 14 more programs translate.
- Counted, not fixed: an indirect compute pass asks for about 77,500
  groups in x and is cut to 65,535.

One five-minute game run of these changes on the test machine: no device
loss, no failed request. This merged tree was built; its test suites
were not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
With VICTORY_TEXTURE_NO_WAIT=1 a refresh that met the runtime remapping
title memory read the whole chain or nothing. A texture the title holds
only the smaller levels of is never all there, so nothing was read, and
the upload recorded before put the staging buffer's zeros over the
levels on the card. A staging buffer never filled now takes the pages
that are there; what was away for the moment of a change is read after
it, and a filling with less than was mapped makes the slots due again
(at most 8 times in a row). VICTORY_TEXTURE_FILL=0: as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Descriptor records the title copies as bytes are mirrored before each
submission. Views off their copy's elements: our rule (raw views too, and
now typed views on 16 bytes), the fork's copies. Wave sums of halves: ours
(the fork's test passes with it). Sizes of descriptors nothing uses: ours,
then the fork's for 2D images. The fork's count of cut indirect groups is
left out: up to WIDEST groups run as asked here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mirror() previously dropped the SHADER_HEAPS lock inside shader_slot() before using the returned &Heap, allowing a concurrent Heap::drop to free the heap while mirror() accessed it. Also guards copy_simple() against invalid descriptor kinds, rejects placed heaps whose address+size wraps u64, and checks offset+count*bytes in resolve_queries() against overflow (with a regression test).

(cherry picked from commit 628b95da5e)
A frame that ends in a packet where no frame begins (the tail of a frame that crossed packets, then padding) left the next frame pointing into that padding, which ended the stream early. Now the next frame is found by following each packet's skip to the next packet with frames.

(cherry picked from commit ba42db643c)
Our own completions looked their call up again by block address: after a
provider's DoWork returned, after a cancel, after a failed begin, and when
queued DoWork ran. A provider usually ends its call itself (XAsyncComplete
from DoWork or Cancel), and once it has, the title may begin a new call on
the same block, from its completion routine or from a thread that polls
the status. The lookup then found that new call:

- the old call's DoWork result (S_OK, size 0) or cancel (E_ABORT) ended
  the new call before it had done anything, ran its cleanup and fired the
  completion routine a second time;
- DoWork still queued for a canceled call ran the new call's DoWork.

Each queued DoWork now carries the call that scheduled it and runs only
while that call is still the block's, and DoWork, cancel and begin
complete that call. A call that is already over ignores a second
complete, so nothing reaches the next call. XAsyncComplete itself still
goes by block, as providers name their call by its block.

(cherry picked from commit d01b17070d)
Fail when a requested scan root cannot be opened. Report traversal errors below a readable root alongside the other skipped inputs.

(cherry picked from commit b1bdd8994a)
A callback submitted with a delay waited on a thread of its own and was
delivered when the delay ran out, whether or not the queue had been
terminated meanwhile. XTaskQueueTerminate only canceled what was already
in the ports, so a pending delayed callback was not canceled: it ran
later as live work (canceled = false), after the termination callback,
by which time a title may have freed what the callback uses.

The queue now keeps its delayed callbacks in a list until their delay
runs out. Terminate cancels them along with the queued ones, before it
calls the termination callback, and a delay that runs out after that
finds nothing to deliver. A submit racing Terminate checks `terminated`
under the list's lock, so the callback is either canceled or refused.

(cherry picked from commit b9ff219826)
`victory run GTA6.exe`, run from the game folder, gives an exe path with
an empty parent, and that empty folder was mounted as G:. An empty path
cannot be made absolute, so the root stayed empty and G:\x64\a.rpf
became \x64\a.rpf: the root of the current drive. The title then found
none of its files.

An empty root is now the current directory, which is what an empty
folder means everywhere else (`Path::new("").join("x")` is `x` in the
current directory). Passing a path with a folder in it is unaffected.

(cherry picked from commit 01ae55a3ba)
imdct_half worked out every pre- and post-rotation with sin_cos on each
call (n of them per subframe) and ran its FFT on two fresh Vecs. The
rotations, the bit-reversed order and the butterfly rotations now come
from a table built once for 128, 256 and 512 samples; the work buffers
live on the stack. Every value is computed with the same expression (the
butterflies with the same running product), so the output is bit for
bit what it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4eb0898b3c)
Decoder::decode took the caller's bit count as the end of the frame. Past
the data the bit reader returns zeros, and a stereo tile header reading
only zeros gives the subframe to no channel, so it never moves on; with a
count beyond the data it never overreads either, and looped for good.
Clamp the end to the bits the data holds. A frame from read_frame always
holds its bits, so its decoding does not change.

Add deterministic noise tests (xorshift64, fixed seeds, as BCPack's):
buffers of noise packets, streams of noise frames with clean and damaged
headers, frames in mono and stereo at each sample rate, bit counts past the
data, and read_frame and packet at any offset. Every walk is bounded and
every decode must give one frame of samples. The bit-count test hangs
without the fix; the others pass on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit d4d1822049)
When a frame ended a loop, decode cut it at the loop's end subframe, set
the loop's skip (the subframes of the loop's first frame that lie before
the loop) and then took that skip out of the frame in hand: the loop's
last. So the head of the last frame was dropped instead, and the first
frame played from its start, with the audio before the loop in it. The
number of samples came out the same; the seam did not.

The pending skip is still applied to the frame in hand, and the loop's
skip is set after it, for the frame decoded next.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 985d8d4b02)
The source resolver's rule (local files only) knew a share as `\..`,
`//..` or `file://server/..`. The host knows more spellings: any two
leading separators (`/\server\share`), the object manager's prefix
(`\??\UNC\server\share`), and a `file:` URL with no host whose path
starts with two separators (`file:////server/share`,
`file:\server\share`, also percent-encoded). Those fell through as
relative paths or drive-less local files and went to the host's
resolver unchanged.

They are refused now, naming the server. Paths with one leading
separator, a drive after the slashes or the prefix, and the path of a
URL that names this machine pass as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 11ca3ce492)
Based on #34 by ka1qux (commit faa0a9a), rebased over #45, which added the
same flag and register helpers for clwb loops; the duplicates are merged
into gpr/cmp_flags/CMP_FLAGS.

clzero: the two loops compilers build around it are done whole in one
exception, leaving registers and flags as the last pass would. Anything else
around it is one line and the next instruction.

rdpru: returns the time-stamp counter for MPERF and APERF, 0 for other
counters, and leaves the flags as they are: a Ryzen 7 5800X3D running it
natively in user mode changes none, for known counters or not.

Added over #34:
- loop 1 rejects cmp rax, rax (it fell into the loop and left wrong flags);
- tests that go through the emulation on any CPU (both loop shapes, the
  rax-rax and wrong-neighbour fallbacks, rdpru with both flag states), since
  on an AMD host the native tests never enter the handler.

(cherry picked from commit 0de9efced179dfb523748f21cf4bdbe0d3aa7533)
(cherry picked from commit e57e76a7b4)
Stack dumps (VICTORY_STACKS, diagnostics builds) read another thread's
TEB right after NtQueryInformationThread and suspended it only later: a
thread exiting in between frees its TEB, and the read faults. The
thread is now suspended first and resumed on every way out.

The dump times went through Duration::from_secs_f64, which panics on
`inf` or `1e20`, killing the dump thread (the crash hook logs it as a
crash). They are parsed by `schedule` now, which leaves out NaN and
times no Duration holds. 1 new test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit acdcc41687)
Calls are filed by their block's address, and a call that succeeded with
a result stays filed until XAsyncGetResult takes it. XAsyncBegin refused
any block whose address had a call filed. So when a title never took a
result and freed the block, the next block it was given at that address
could not begin a call: E_INVALIDARG, every time, with the old call's
provider never cleaned up.

A zeroed block is a new one: the block of a result left behind holds the
result's size, so it never reads zero. XAsyncBegin now ends a finished
call filed under the address of a zeroed block (its provider gets its
cleanup) and begins the new one. A call still in flight keeps its
address, and a block still holding a result is refused as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 5cff0007a5)
The decoder fills an XMA voice's output ring until the write block
(word 0, bits 27-31) comes round to the title's read block (word 9,
bits 0-4). The write block wraps modulo the ring size (word 0, bits
22-26), and so does a read block moved on by command 18, but a read block
the title set up at or past the ring's end was compared as it was: no
write block ever equalled it. With a stream that loops forever the pass
never ended, holding that voice's lock, so the title's next command on
the voice (advance, disable) waited for good, and releasing the context
arrays did too.

Take the read block modulo the ring size as well, as the write side
already does. A test sets up read block 6 on a ring of four with an
endless loop and requires the pass to end within seconds, with blocks 0
and 1 filled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 1054fe87de08038e887d6f7c6f44e5b07ac7a9f9)
No graphics object's interface list holds IUnknown, so QueryInterface
for it (and every call that hands out an object by interface id) said
E_NOINTERFACE and returned null. COM code asks for it to compare two
pointers for identity, to keep an object as a plain reference, or to
pass it on to an API that takes any object.

object::is, which all of those go through, now also matches IUnknown.
The DXGI device answers with the D3D12 device, which it already stands
for: one pointer whichever of the object's interfaces is asked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 92f2c60c8159e34a47570aa81f3d25624cc6db5c)
XStoreQueryPackageIdentifier documents E_INVALIDARG for a store id that
has no installed package. We returned XPackage's 0x89245208 instead.

(cherry picked from commit e3bef089855cc4b463a0ce7e1a70f6abf7c859e5)
host::module held the module cache's lock while it called
LoadLibraryExA. Loading a DLL that is not loaded yet takes the OS
loader lock, and title code runs under that lock too (a title DLL's
thread attach, TLS callbacks run as threads start), where it can need
the cache: any first use of a host! function, or a late-bound title
DLL. One thread holding the cache and waiting for the loader lock,
another holding the loader lock and waiting for the cache: the process
hangs, and cannot even exit, as ExitProcess needs the loader lock too.

The cache is now looked up, then unlocked for the load, then locked
again to keep the handle; a thread that loaded the same DLL meanwhile
got the same module, which stays loaded.

(cherry picked from commit c6959acba38304852c185bcd7bc2ba1478d6e0b2)
(cherry picked from commit 93a24b7cdaeb0e7f132f711e9cbd9ba405b0f639)
The MicrosoftGame.config reader ended a tag at its first '>', but XML
allows '>' unescaped inside an attribute value. A value with one
(DefaultDisplayName="A > B") cut the tag short: its '/>' was never
seen, so the element stayed open and every element after it was read
as its child. Game/TitleId and the storage quota were then not found,
and the title ran as id 00000000 with no storage quota, its saves and
temporary files in that folder, without a warning.

A tag now ends at the first '>' outside quotes.

(cherry picked from commit d549b6397e3f40e77f9da670344aa15f12b26abb)
Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e6ebec9ccf0bc27cfe0b5509ec3d07a0969eb25f)
XGameUiShowTextEntryAsync documents a 1024-character maximum on console,
1024 for a maxTextLength of 0, and 1024 for the Password scope whatever
the title asks. 0 meant no limit here, larger limits were kept and the
scope was ignored.

(cherry picked from commit 936e5e51c91c7b380a4729aeaa2255824ce8085a)
A slice may not start at null, even an empty one, so asking for a title
image's name with (NULL, 0) was undefined behaviour; a debug build
aborted the process. A null buffer is now no buffer: nothing is written,
0 is returned and the last error is ERROR_INSUFFICIENT_BUFFER.

(cherry picked from commit c000581df2cf12aaadfe49025f9abba8b5993c8e)
(cherry picked from commit 2c22e2b2d23ef2c6e79e67d5cff51d5c8ec3475d)
(cherry picked from commit a3f89eda547690efa8542b8b993b9de894f05bb1)
(cherry picked from commit 75fe6c02b278f18eab33ad893bda1dd68d176287)
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In #289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since #51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 65062e133c75c3b6e984ac51e904512d41f71f93)
(cherry picked from commit b796c8b8b80cfa4506f254474ab9fd7260bfd8e6)
An instruction guard depends on its EXEC and the reachability of its block. Keep the most recent result, including an elided guard, rather than repeating the same BDD queries for consecutive vector instructions. Scalar instructions still bypass guard selection.

Cover EXEC changes across and within a branch with a synthetic shader. Add a CPU-only guard_runs benchmark for unmasked, short, and long masked runs.

(cherry picked from commit 81b81df351437c50f4321286c725de51664c7b1b)
The run check split on every byte that is not alphanumeric or +/=, so
b"\x4d\x5a..." broke into 3-character pieces and an xxd -i style
[0x4d, 0x5a, ...] array into 4-character pieces. Either form of up to
about 100 KB of copied bytes passed the check and the pre-commit hook.

Also count the hex digits of \x escapes and 0x literals that have only
commas, whitespace or backslashes between them, and flag the file when
that passes the same 512 limit. The largest such run in the tree is 36
digits. Decimal arrays are still not caught.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e950e81756340b10c3ef87d9c1789ae482f1a262)
Six diagnostic switches (VICTORY_D3D12_DEBUG, _GBV, _DRED, _WARP,
VICTORY_GPU_TIMING and VICTORY_DUMP_TARGETS) were on whenever their
variable existed, so VICTORY_D3D12_WARP=0 still selected the software
adapter. They now go through one helper that reads a value other than 0
as on and an unset variable or 0 as off; every other value keeps the
meaning it had. The README says so above its switch table.

(cherry picked from commit a4974e4c21c16e2305942e37a868647d42eefe37)
The disassembly text showed operands that some instructions lack, and
dropped VOP3P negation that applies to one half only:

- s_memtime, s_memrealtime and s_get_waveid_in_workgroup printed the
  unused SMEM base and offset.
- A global or scratch access with no SGPR base printed `null`, not `off`.
- A MUBUF load with lds printed the unused vdata as a destination.
- VOP1 SDWA printed src1_sel, though VOP1 has no second source.
- VOP3P ops other than v_fma_mix with only neg_lo or only neg_hi set on
  a source printed as if the source were not negated. These now get
  LLVM's neg_lo:[..] and neg_hi:[..] suffixes; a source negated in both
  halves keeps `-src`.

Expected operands come from llvm-mc -mcpu=gfx1030 (gfx1010 for
s_get_waveid_in_workgroup). Only the text changes; translation reads
Fields and is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 6325df752c5638365c3e5a2b2f827ba0f3f145cb)
translate writes emitted DXIL and validator reports to the
VICTORY_EMIT_DUMP directory. Both are derived from the game's shaders,
but the directory was never checked against the source tree. With
VICTORY_EMIT_DUMP=. run from the checkout, the .txt reports land in the
repo, and git and cargo xtask policy both let them through.

Check the directory once at the start of translate::run, as Config
already does for the cache and data directories.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 988fd9a64718ee9a235cff3b60192b6b86006c4d)
(cherry picked from commit 350f91c23a9402b2a556a84c208a80030910ae3f)
(cherry picked from commit 43e2ca9de29f5833941970e82ed89872c9f86a81)
(cherry picked from commit efe102edac86f365a9951f3c92228413cbee8e46)
(cherry picked from commit 7216ab7113115ea1accfabc6e3a00ee700c7c846)
Preserve stale staging files left by interrupted writers and retry a bounded number of atomic create_new attempts. Propagate unrelated I/O errors immediately. Add deterministic CPU regressions. AI-assisted.

(cherry picked from commit a32eacdd5e0f2e55b5c0cddeb0d44d5fa93f9bb9)
(cherry picked from commit aaacc2dcfe09afc10d0893b0259ef20afd326280)
Co-Authored-By: GPT 6.2 Sol <[email protected]>
(cherry picked from commit 64b80c310941c8c105c9ac78fe4c29004f5e88a4)
(cherry picked from commit 121412bec21b0790d04d56399f49e2d140652864)
Co-Authored-By: GPT 6.2 Sol <[email protected]>
(cherry picked from commit 3e98bd7e0ce79762162ac958e3ab67cc85de00c9)
(cherry picked from commit 6d174aeeeb93669ab9f43ff01b24963933433af8)
(cherry picked from commit 131944d02dc0b37469f85f907234c664eb8027af)
(cherry picked from commit 0be58e62d24181a9eb60244a7e4d878a3627d401)
The PE-specific export table stores one name per address-table slot, so when two names alias one ordinal the earlier name is silently dropped from ImageInfo and from victory inspect --exports. Use the generic Object::exports iterator instead, which yields every named export and then ordinal-only entries, and map its target and flags back to our representation. Add a synthetic PE regression with two names for one ordinal plus a separate export.

(cherry picked from commit d0dd9fc5c01ce2e7e82047b4ab7e5b4821c82d7a)
write_if_changed used a shared <hash>.tmp file, so two concurrent cold launches of the same image could truncate each other's staging bytes or fail the rename after the other had published. Move publication into a portable module that stages under a unique pid/sequence name and removes it on failure. Two hermetic tests cover concurrent publishers and a failed rename.

(cherry picked from commit 1aac20aa8fd97237053c985b942225d54c0194a7)
elements() took field text up to the next '<', so a generator comment before the value made TitleId, StoreId or SizeMB empty. Skip comments while gathering the text. Add a regression with comments inside all three fields.

(cherry picked from commit ca362a42473bb0f8f9a83377091287a621e94527)
runtime stores an absolute image path while relaunch_args searched raw CLI arguments for exact text, so a relative launch argument made XLaunchNewGame silently rerun the old title. Normalize the argument the same way runtime does before replacing it. Also split the title's quoted config args into proper arguments instead of split_whitespace. Add a regression covering a relative startup path, a different target and quoted/empty args.

(cherry picked from commit 71e88665c44f6f82370e2fb84e6d2358c1e7b180)
`resolve` canonicalizes the longest existing prefix and re-appends the rest, but it walks up with
`Path::file_name()`, which is None for a trailing `..`. A path such as `<tmp>/a/../b` (nothing exists yet) hit the
`_` arm and returned PolicyError::Io, so a cache_dir or data_dir with a `..` in a directory that does not exist yet
was rejected, and `normalize`'s `..` handling for the missing tail was never reached.

A trailing `..` is now kept in `rest` so `normalize` resolves it lexically.

Test: resolves_dot_dot_in_a_path_that_does_not_exist_yet (fails before, passes after). cargo test -p victory-core,
cargo fmt --check and cargo clippy --tests are clean.

(cherry picked from commit 52f0a099ede8aa4d5bde61a0c46963a77a4378ba)
(cherry picked from commit fd44561ea1180aff5380285527fb8cac8195f4e8)
emulate_amd_only copies only the bytes left in the faulting page and
gated clwb_len on n >= 15 because clwb_len took a fixed [u8; 15]. A
4- to 10-byte clwb starting in the last 14 bytes of a page (or falling
back from a clwb_loop that straddles the page end) was therefore
skipped, leaving pre-Ice Lake Intel CPUs with an unhandled
STATUS_ILLEGAL_INSTRUCTION.

Change clwb_len to take &[u8], bounds-checking each byte read and
returning Some(len) only when len <= code.len(), and drop the n >= 15
guard in emulate_amd_only.

Fixes #924.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 60d2cf9cbcf5a2abc773d5de10c3c892e77d3340)
(cherry picked from commit 246ecea9631acfe1b694421c6c600e3981a1f752)
(cherry picked from commit 534e1dd74c57448bef4c525e204acc123387d6f2)
Read complete payload bytes directly inside an XMA2 packet. Keep the bit reader for packet headers, interleaved stream skips and the final partial byte. Add coverage for all eight alignments at packet boundaries and EOF. On Windows x86-64, 36,720 synthetic reads matched the previous implementation, including returned bytes and the next frame position. A release microbenchmark of read_frame measured 1009 to 168 ns for 128-byte frames and 7977 to 1062 ns for 1 KiB frames (median of nine runs).

(cherry picked from commit 03a6f22906b4372ec08d003e9103997659647b0f)
(cherry picked from commit 8610ffb85baedbc7b8c4c9de1222b0911e00e589)
(cherry picked from commit e3c9dd0d53d92d7a1dc7b86d75147d3ed390c61a)
(cherry picked from commit ef0c3e944916e2273457626be3d34f8dd5591eb4)
With TdrLevel 0 Windows never resets a hung GPU: a slow or hung world
frame freezes the whole desktop, and the runtime never sees a device
removal it could report (#1054). With 1 the timeout is a blue screen.
Both are set by hand, often to keep slow frames from being reset, and
reports of "the PC froze" do not say so.

When the host device is made on a hardware adapter, read TdrLevel,
TdrDelay and TdrDdiDelay from HKLM\SYSTEM\CurrentControlSet\Control\
GraphicsDrivers, log them ("default" where a value is not set), and warn
for TdrLevel 0 or 1 with what to set instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 42961e8e577e5f195db0982e34bb59e800998c77)
Closing the window never suspended Grand Theft Auto VI: its suspend
routine waits for a state that only its constrained-change routine
starts, and RegisterAppConstrainedChangeNotification bound to the host's
version, which never calls it. Every close ended in the one-second
deadline.

Register constrained-change routines here and run them (constrained)
before the suspend routines (quiesced), as the console does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a7847a520197a45425bccf803a644e1968de67b2)
Getting started names Rust (pinned in rust-toolchain.toml) without saying
how to get it. Add rustup through winget or rustup.rs, that the pinned
toolchain then comes on the first cargo command, and the MSVC C++ build
tools the Windows target needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 098a26aad5e3ef4655a9282f78cf713a2fc01a55)
Microsoft's XAsyncCancel reference says: "If the XAsyncCancel function
is invoked for an asynchronous call that has already completed, nothing
happens."

A call that completed successfully with a nonempty result stays in
CALLS until the title reads the result via XAsyncGetResult, so
XAsyncCancel still found it and invoked the provider with OP_CANCEL
before XAsyncComplete returned early on call.done.

Check call.done under its lock in XAsyncCancel and return immediately
when the call is already complete, dropping the lock before invoking
the provider.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 44ce06784b9ff8c7d9ab7ea4a9db02d72ee7804f)
(cherry picked from commit 142ec8dd4563608b67ffabc8ba47175508f9a660)
(cherry picked from commit 643fc6dfecffbd06de7313897b7d4bc4ffef6564)
(cherry picked from commit 64a33ec757c1da0963a6821cd59995b8efabe946)
(cherry picked from commit 4f54c4775574e78ea7a869eae6605a401b107db3)
(cherry picked from commit 1ed26e50d860f328cd42c640bc12486f65603995)
(cherry picked from commit 32eb93495919655651e6b64be31e68b71af70422)
(cherry picked from commit 5c44562868df4c33cce60488132d83cf5ff02f30)
(cherry picked from commit 4e155a36ad728e1a21e7253ff4097af06582a45f)
(cherry picked from commit 2b13ae41920296be79dc9642913a7807ecc98d57)
Check both mask widths, the condition code and the zeroed upper destination.

(cherry picked from commit e3fe5bf94f848c2a6ca36900c2dfa70342083109)
(cherry picked from commit a7636dd7b1a4a76eaa4f1cf211d2ff31faacc3f5)
(cherry picked from commit be3202de393b71c9385f74b587256b01b48f7f63)
(cherry picked from commit 711d651ccab7673e5ab4365bd692294e954c845f)
(cherry picked from commit 9ccb83c00a9b0ee5121e4a9b2f6c0ee223630c84)
(cherry picked from commit 274f6988c9779b0612186c3448123e5e157d56e4)
The layouts follow AMD's addrlib, but the tests only checked them
against themselves (every element on its own address) and a few
hand-worked offsets. Two tests now pin them to addrlib itself
(Mesa src/amd/addrlib at ed09d38, Navi 21 settings):

- layouts_match_addrlib: 21 descriptions over every mode Layout::offset
  addresses (linear, 256 B, 4 KiB and 64 KiB S and D; 1-16 byte
  elements, block compression, arrays, mip tails, 2D and 3D), each
  with addrlib's surface size, first tail mip and a hash of the
  address of every element.
- deep_volumes_keep_their_chain_in_each_slabs_tail: a 16x16x64 volume
  whose chain is all in the tail (addrlib's mipChainInTail), with
  explicit addresses: each 16-slice slab has its own tail block, and
  mip 1's 32 slices span two of them.

Over a wider sweep (about 20,000 descriptions, every mip count for
volumes up to 256 deep) main matches addrlib exactly in size, tail and
every address compared. A tail-entry rule that also requires a mip's depth to
fit one slab changes 5,456 of 14,780 volume layouts (5,087 grow, by
up to 5x) and moves their addresses; both tests fail with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit f078008b112343b6e68c8ca72b884073064320c1)
fence.rs already implements ID3D12Fence1::GetCreationFlags at slot 11
(0x58), but FENCE_IIDS only listed ID3D12Fence and PAGEABLE_IIDS, so
CreateFence and QueryInterface rejected ID3D12Fence1 with E_NOINTERFACE.

Add ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) to FENCE_IIDS
and add a unit test covering creation, QueryInterface, and
GetCreationFlags.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit bbdc3ca7249948b7624ba65f4282615caef895b8)
A package copied without the DLLs that ship beside the executable leaves
every import from them unbound, and the title stops at its first call into
one: Grand Theft Auto VI 1.0.2.1 at +0x2237178 during System Init (#930,
#1553, #8), with nothing saying why.

After mapping the title DLLs, name the main image's static imports that
must come from the title's folder (neither the host nor our runtime serves
them) but were not mapped from it. Print them; when executing with the
default trap policy, stop before running title code. With
`--unimplemented zero` the title still runs (stubs were asked for).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e9cb14ad3ea2f7a3ec051d9f9691684d7e9037ae)
save() releases LAST and library locks before calling write_atomically(), which always wrote to the same fixed host-pipelines.tmp path. Concurrent worker saves and shutdown save(true) can truncate or unlink each other's temp file on Windows.

- Serialize write_atomically() with a mutex and unique per-call temp filename (.tmp-<pid>-<n>), cleaning up the temp file on rename failure.
- Add a 4-thread concurrent write_atomically stress test.

(cherry picked from commit be824d9d218320c71f2623ed4b14045210785db5)
(cherry picked from commit eb7cc2d43711e806bbd8578d4ef75bde30326c20)
A title makes its window on one of its own threads and reads its messages
only when that thread reaches its PeekMessage loop. In slow frames and
loads that is seconds apart, so the system shows the busy cursor over the
window and a click turns it into a "Not responding" ghost.

A top-level title window is now made message-only (it can never be shown),
and a stand-in window with the title's text, style, icon and fitted size is
made on a thread of ours that does nothing but pump its messages. The
title's ShowWindow shows the stand-in, its window text follows, closing the
stand-in suspends and ends the title as before, the keyboard window menu is
still refused, and the stand-in goes when the title's window does. Frames
are presented to the process's visible window, now the stand-in; input is
unaffected, since titles read it through GameInput, not window messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9145d9d3dabb0d5f8263b4203a82586710929d90)
(cherry picked from commit 8d3a025df199e6e26ccb404d4cf0f172fdde8b1c)
A title that ends itself when its main loop has not ticked for a while
runs on through slower frames.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 532cb7cdfee02e6139a683f79ee4c9b4a92828a4)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 70564ae08c82d43df5fad97b08d34628b07b1d9d)
`Instruction::name()` binary-searches the opcode table, and the pipeline
asks about every instruction eight times per translation: `ir::build`,
`structure`, `resource` (which has the most call sites), `io` and
`lower`. The answer cannot change - the encoding and opcode are decoded
from the words and never rewritten - so resolve it once when the
instruction is built and read the field after that.

Measured with the synthetic bench from #1002 (no game data), sixteen
interleaved rounds per arm, best of each, nanoseconds per instruction, at
256/1k/4k/16k instructions:

  resource     17 -> 9, 15 -> 7, 24 -> 16, 23 -> 15    (0.47-0.67)
  lower       511 -> 479, 428 -> 411, 440 -> 401, 477 -> 428  (0.90-0.96)
  io           27 -> 23, 26 -> 21, 26 -> 22, 30 -> 22   (0.73-0.85)
  whole       926 -> 881, 920 -> 874, 958 -> 921, 1019 -> 939 (0.92-0.96)

`decode` pays the one search it used to be spared (112 -> 115 at 16k,
inside the run-to-run spread); every stage after it reads a field. The
emitted DXIL is byte-identical at all four sizes.

cargo test --workspace --locked: 342 passed, 0 failed, 7 ignored.
Both clippy configurations clean; cargo xtask policy ok.

(cherry picked from commit 146dfef67a3ecd2c4fd8f9cff8de149c65dfe6f0)
Recovery took any name `v<digits>` as a version, so a leftover `v01`
next to a committed `v1` parsed as version 1, and the cleanup rebuilt
the name as `v1` and deleted the committed save (#870). A correctly
named but unreadable newer entry (an empty `v2`, a file, a broken
manifest) did the same: `v1` was pruned as older, the read failed, and
the next update committed a fresh `v1` holding only the changed blobs,
which the following read pruned again.

Now only `v<N>` exactly as `commit` writes it is a version. `current`
takes the newest version whose manifest reads, removes only versions
below it, and leaves unreadable newer entries alone. An update goes
above the highest version name present, so a stray entry neither hides
the save nor blocks writes. With no readable version at all, reads and
updates still fail and nothing is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b8dbcba260d1012dca8f06ee572e5244bffba1ac)
The fork's emulation of a clzero loop zeroed from the start to the end and
left rax at the end: the instruction zeroes whole lines and the test comes
after it (VIctory's own test of it failed here). The title's descriptor
heaps are held shared while their slots are written (VIctory 628b95d held
them alone, for every thread that writes descriptors).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).

(cherry picked from commit eb8067f2eae84cb64081af357cd03a48944a42b2)
The write block (context word 0, bits 27-31) was used as it is for the first
block of a pass, so one at or past the ring size (bits 22-26) was written
past the ring's end, possibly into another APU allocation, before it wrapped
with (write + 1) % size. Take it modulo the ring first, as the read block is
taken, and as advance_read does.

(cherry picked from commit 7a5d85e6a2867081ed54515ce7f33bae3fcb643d)
16-bit interpolations write the half op_sel picks, with omod and clamp; the
device says whether it was removed; detiling ends with its staging buffer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 9820bdc45e.
A removed device is reported by whoever finds it first, and the list it
stopped in by its name. The window stand-in of VIctory 9145d9d is left out
until it has been tried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lamps' shadow maps write depth plus a slope bias, and the main pass takes
the normal's derivatives, from the quad's other lanes; a wave read of a helper
lane is undefined (0 on AMD): holes in shadows, dashed triangle edges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- VICTORY_HEAP_SYNC=all mirrors every copied record at once, as before.
- VICTORY_DYNAMIC_SLOTS sets the table slots past the title's.
- Room kept for card copies of buffers is 1 GiB at most (was 5 GiB on 24 GB).
- VICTORY_TEXTURE_KEEP=0 lets idle textures go after 5 s, as before.
- VICTORY_TEXTURE_AWAY_MS: a texture whose memory went is shown 3 s longer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both device losses of 2026-11-25 (play-1125-0203, n02) stopped at the same
place, found by the run of three indirect executions between barriers in the
captures: compute 0452fc2d2e2fc4c3 (meshlet culling), behind fc5e66f8f873d3bb.

- With device-removed data on (DRED=light too) each list keeps, per indirect
  execution, the pipeline and the first 16 dwords of user data; the report
  says them for the stopped commands, and what the heap slots they name hold.
- A dynamic slot that shows a constant buffer in a list's scratch chunk holds
  that chunk (n02: the fault was in the memory of three freed chunks).
  VICTORY_SLOT_HOLDS=0: not held, as before.
- A slot's resource is let go after its descriptor is written over, not
  before; the same resource again is not retired.
- indirect::tests::raw_loads_past_views (ignored, a measurement): on the RX
  7900 XTX raw loads through typed, structured and constant buffer views have
  no end: they read whatever lies after the view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both losses were reads in memory given back seconds before. Empty texture
blocks (up to 4 GiB) stay below 85 % of the card's budget, windows of title
memory and staging buffers stay for five minutes with 12 GiB of the PC's
memory free, and up to 1 GiB of scratch chunks stays. Nothing read past a view
or through a wrong slot finds the hole then. VICTORY_KEEP_FREED=0: as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer a shader picks from the view heap by an index it computes is read as
raw bytes, whatever view the title has there, and the index and the offset
come from data. On AMD a raw load through a typed, structured or constant
buffer view has no end (measured), a texture's descriptor read as a buffer's
is a wild address, and an index past the title's slots (clamped to 2^21)
reaches the dynamic slots of other lists. Both device losses of 2026-11-25
stopped in the meshlet culling (0452fc2d2e2fc4c3), which does such reads.

View heaps now hold 2^22 views: past 2^21 a raw view of the same bytes for
every buffer view of a title slot (a constant buffer's view for a constant
buffer; a null raw view for everything else and every slot past the title's),
and picked raw and constant buffers are read there. Texture and typed picks
and tables stay as they were. A view that does not begin on 16 bytes cannot be
raw; its twin is the view as it is. Idea of a guard by kind: VIctory d71c3889.
VICTORY_RAW_VIEWS=0: as before. Every shader is translated again (8 min).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After victory-amd bddfb4a5 (myokex).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Placed textures are read, kept on the card and uploaded from the first level their views show (VICTORY_HELD_LEVELS=0: whole;
after victory-amd 4436f8f1's spans). An upload of the bytes a host copy holds is left out (VICTORY_TEXTURE_SAME=0). A slot
shows its new view once that view's upload has run. A decoration bake takes slots due a few frames later too and waits for
memory being remapped (VICTORY_BAKE_EXACT=0). Host copies go only past 88 % of the budget, the longest idle first
(VICTORY_TEXTURE_KEEP=1: the rule before). A slot rewritten with other filler words keeps its view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Samples the 28 busiest threads, whole stacks, with what the frame is at.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
All of the title's loading goes through one thread of its own, which maps
the pages of a batch and then submits it. Each page took up to four system
calls (unmap, split, map, commit), each waiting for the address-space lock:
200-400 us a page in the world. No split of a placeholder that is the
view's own, no commit of section pages that are committed
(VICTORY_MAP_LEAN=0: as before); the thread, below normal priority as the
title sets it, is lifted above it where it maps (VICTORY_STREAM_PRIORITY=0:
not). VICTORY_DSTORAGE_LOG=<file>: every request, status entry and the cost
of the mapping calls; VICTORY_STACKS names each thread's affinity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_PROCESS_PRIORITY=normal and VICTORY_PIPELINE_LOWEST=0 for the old
ways.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ray-tracing structure builder's 52 programs translate, validate and make
host pipelines on the 7900 XTX (its waves have 32-64 lanes). What kept it from
working, from a first run (light-1, VICTORY_BVH_QUARANTINE=1) and the code:
- a root view ends with the host copy (a 4 MiB window); structures of megabytes
  cross it. Programs with a spilled user-data table now reach what their root
  views name by address (USER_ROOT_ADDRESS), as upstream VIctory 0f637570 does.
- the list's upload memory (instance descriptions) came from the process heap,
  above 2^40, where shaders' addresses do not reach (upstream 0f637570, 6d021fe3).
- the 1,023 numbered copies of 4 MiB ran out in the first frame: pages come in
  windows of 256 KiB (4 MiB around what a dispatch names), 16,383 at most.
- what the builder stores came back to title memory; now only what it stores in
  small title buffers it names (sizes the title reads).
- the directory lay in the PC's memory and every access stored a fault note.
- a list without a view heap gets the title's; a dropped stage rests the builder
  for a frame, not for the run.
Off unless VICTORY_BVH_BUILDER=1, as before. VICTORY_UPLOAD_LOW=0,
VICTORY_LENT_HEAP=0, VICTORY_MEMORY_WINDOW_KB, VICTORY_MEMORY_CARD_MB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run crash-1 held 5.2 GB of staging blocks (n02: 0.9): at most 8 empty ones
stay (512 MB of the PC's memory). With the frame line: raw twins made per
frame, and those that had to be views as the title's are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
GPU_UPLOAD heaps, all off by default. Replayed yard frame (capture
play-1125-0127): 36.3 ms; windows in the card's memory 31.9, sends 32.7.
Replay: --pace, --breadcrumbs, copies counted by the memory they cross.
VICTORY_GPU_LOAD_MS: what the title's GPU timestamps show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_RECHECK_SOON=0: after four frames, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One by one, every fill of the 2,800 a frame sorted the ranges again: the unmeasured 16 ms before a submission's preparing (profile cpu-1). Up to 12,288 steps a submission.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Words are pairs of one dispatch and are not counted against the 4,096 copies a submission sends up, at which it stood until the flights had landed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Made anew and given back all the time: 30 % of the submitting thread in the opening (profile cpu-1: allocations of snapshots 11, preludes 12, lists dropped 5, send memory 3).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changed pages are compared sixteen records at a time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_ASK_EARLY=0: no such thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 ms of the submitting thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
12 to 17 ms of one recording thread at the frame's first list that needs it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A captured frame whose lists take 28.6 ms sent in one go takes 37.8 ms with
1.2 ms between its submissions, as the game sends them; with one group of
threads counting on a compute queue it takes 28.6 ms again, and nothing
changes when sent in one go (36.1 against 36.3 ms with its copies).
=turns: 20 s on, 20 s off, to compare in one run. Replay: --awake,
--no-restore makes no copies to restore from.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Windows of title memory around every page took 8 GB (run light-2, 0.5-1 s a frame): structures are streamed in anywhere between other data. A 64 KiB page outside title buffers now has a page of its own in an arena on the card; only the title's GPU memory is taken; what instances in a list's upload memory name is there before the top level is built, 1 MiB from each root view before the rehydration stages unpack it in place.
VICTORY_MEMORY_DUMP=<folder> writes the arenas out (diagnostics).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What the copy does not write was whatever the block of the pool held: the atlas of baked decorations (a 2048x2048 BC3 texture of
which a bake writes 256x256 at most) drew other textures' bytes over the waitress's face. VICTORY_COPY_OVER_TITLE=0: as before.
With a measurement of what a cold texture costs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The arenas of run light-3, read offline: 2,833 instances, valid top levels and dynamic structures, three quarters of the streamed ones unpacked right. The rest were unpacked a second time (the same bytes streamed in again do not differ from those last taken), into garbage over their neighbours. And the sizes the title reads of a structure (compaction) never came back where their small buffer lay in an arena's page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on the RX 7900 XTX (indirect::tests::descriptors_written_under_readers):
a thread that makes texture views in a slot of a shader-visible heap lets the
card see a descriptor that is neither the old one nor the new one in 4 % of its
reads (35 of 822 million: the driver clears it and fills it step by step).
Copied from a CPU-only heap: none in 8,582 million reads, and three times as
fast (51 ns against 149). Title threads and our passes rewrite slots while
submissions run whose shaders pick them; three device losses of 2026-11-25
(play-1125-0203, n02, n03) were reads of memory no view names.

Every slot of the host heaps (views, raw twins, null views, constant buffers,
samplers) is now made in a slot of the thread's own in a heap the card does
not see and copied in. VICTORY_VIEW_COPY=0: made in place, as before.

A raw twin whose view begins between two multiples of 16 (35 a frame, left as
the title's unbounded view) is made from the 16 bytes below and its descriptor
moved on, if it is the one AMD's raw buffer descriptors are; null otherwise.

indirect::tests::textures_read_in_another_dimension (a measurement): a view
read in another dimension or level than its own gives zeros or its own texels:
not a cause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_TITLE_PRIORITIES=0: as the title sets them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mapping and unmapping a view wait for what every protection change of a
view takes too (about 100,000 a second, the guards'): 0.2-4 ms a page, all
on the one thread the title loads with. Scatter maps and the GPU's
page-mapping copies go in groups of up to 64 pages, noted before and after
on the caller's thread, the system calls on up to eight
(VICTORY_MAP_THREADS=1: one after the other, as before).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-shader/src/emit/mod.rs
Where the kernel or a landing names them; what is checked stays a page. VICTORY_ASK_EARLY=<ms> turns the early asking on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
580 a frame, 3.4 to 6.5 ms of the submitting thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every 4 ms while submissions come, on the thread for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
13 % of the title's main thread while walking (profile cpu-1: two kernel calls for each 64 KiB page).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
xmem.rs is local/next's: its side-by-side mapping (VICTORY_MAP...) takes the place of 4180818's runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A directory entry says whether stores by address reach its page (translator and host). Faults take at most 128 pages a frame and 8,192 in all; every slot of the copies' run holds a null view until its copy is there; a page is looked at once a frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Runs n03 and n04 lost the device in the main pass. The pixel program
3711fdad456538a1, bound in both stopped lists, reads entry 35 of its big table
as raw bytes per lane, and that slot is a structured view of 8 byte elements
that begins at 8 mod 16 (capture play-1125-0127, all 766 draws): no raw view
begins there, so it stayed structured, and a raw load through it has no end on
AMD. So not only picked buffers: tables' buffers too, in title slots and in
the dynamic slots, which have twins now as well (a constant buffer of a fresh
table has a raw one of its bytes).

Measured with it: constant buffer loads, uniform and per lane, end with a
constant buffer's view. Loads by title address end with the raw view of the
copy, or read the null view for a page without one. VICTORY_RAW_VIEWS=0: as
before. Every shader is translated again (5 min).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After victory-fork f85101b6, whose window checker found 90 records of 2^24 vertices in one list; ours
also run mesh records over 65,535 groups (all ones) empty instead of as 65,535 groups.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A bake's uploads waited for the lock the runtime holds while it remaps, and a staging buffer a draw kept waited at every later
refresh (29 to 239 ms a frame, all threads, run n04): gone, a read through the kernel gets every page. A staging buffer made for
one upload asks neither the write watch nor the guards (VICTORY_TEXTURE_ONCE=0: as before). blake3 makes way for a 128-bit digest
(0.035 against 0.2 ms a megabyte). While textures are kept for minutes the sweep looks at 8,192 a time (VICTORY_TEXTURE_SWEEP=whole).
The pass before a bake is made again only for something new.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 MiB for every constant that looked like an address took a third of the pages (run light-5). Which pages came for what is in the ten-second line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pieces went through the title's address, guards opened, whenever the runtime was mapping pages, which is most of the time since they
are mapped in groups (28 of 1,620 pieces a frame beside the guards in run textures-4, 640 before): 5,000 blocks opened and 7,000
guarded a frame. VICTORY_LAND_ANYTIME=0: as before. The vertices of rectangle lists are read through the kernel at submission, not
under the lock the mapping holds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
monitorx and mwaitx raised an illegal instruction exception at every pass of
the title's wait loops. Diagnostics builds log the faulting console
instructions a second by kind and place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The idea is fxceless/victory-fork's, commit f85101b6. Here one line holds
what all queues were given, presents too, in the order of the calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_COPY_OVER_TITLE=title: over what title memory holds; =0: over whatever the block of the pool held.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
4.6 twins a frame of run crash-3 were null because they begin off a dword (16
bit values at an odd one); the typed view they stand for begins there as well.
Measured (raw_loads_past_views): a raw view moved on by 8 bytes gives the
bytes from there and ends where it should, uniform and per lane.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-gpu/src/shadow.rs
An arena another list made while this one was being recorded was brought up by that list's submission alone: structures unpacked from zeros, then written over by the arena's first upload. In run light-8 half of the 470 structures unpacked in the frame with the most (1381) were wrong, 5-15 % in frames with few. A title buffer the builder stores in sends up only the dwords the title changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dumps of runs light-8 and light-9: of structures of the same size some are unpacked right and some not, more of them in frames that stream much. The title's queue waits for its streaming, so a packed structure's bytes may come after the dispatch that unpacks it is recorded. Not run in the game yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run cpu-5: 25,000 exceptions a second at five clzero loops of one function
of the title, against 1,400-7,000 at the one monitorx/mwaitx pair (28,000
at the monitorx alone with only the mwaitx replaced, run cpu-6).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With device-removed data on, every buffer, texture and texture block stands in
a book with its address (a texture's is the base in its first descriptor) and
stays with the time it went. A device loss prints who has and had the faulting
address, newest first, and every slot of the view heap whose descriptor
reaches it, with what our books say of the slot. VICTORY_BOOK=0: not kept.

VICTORY_SLOT_CHECK=1 walks the view heap (2^22 slots, 3.8 s a round) and says
which slots name memory that is gone. Run crash-5 (opening, -Walk, 260 s): 1.7
million descriptors a round, 105,352 things alive, 27,342 gone, none of the
slots named anything gone or unknown in any round.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cpu_sets and keep_on_fast_cores are fxceless/victory-fork's (framelog.rs,
commit 0b0074e0). Asked for by: submit, relay, late-wait, heap-sync, aside;
and the helpers of the wide copies (refreshes, fills, snapshots) and of the
landings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The lists' notes for a lost device hold direct mesh dispatches too (pipeline,
  groups, user data): run n06c stopped among them.
- A mesh dispatch of more than 65,535 groups is cut to that (more is undefined
  on the host; said once). Vertex and index buffer views end with the copy they
  show.
- indirect::tests::loads_far_outside_views (a measurement): raw, typed,
  constant buffer and texture loads at the ends of 32 bits, uniform and per
  lane, samples at coordinates, levels and gradients that are no numbers: all
  198 ways end inside their views on the RX 7900 XTX.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lists already on the card read our descriptor heaps as they are; only lists sent later wait for a new
heap's mapping. Run n08's loss: a page fault in a texture made that instant, in a new block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diagnostics only. VICTORY_TIMELINE=<file> records three frames (or
VICTORY_TIMELINE_FRAMES) after VICTORY_TIMELINE_AT seconds and writes a
Chrome trace and a text summary: spans of our work, the waits and wake-ups
of the title's threads (its imports) and of ours (our import table), long
kernel calls on the address space, and when each submission ran on the card.
The summary walks back from each present through who waited on whom.
Nothing is wrapped without the variable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 008de5f9ffcef132079b1af8b7f4f1c22235cee9)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Timeline waits-1 (dorm, 78 ms): the title's render thread stands 20 to 30 ms
a frame at one recording job and the rest at others; recording is the
critical path, and our list calls are 95 % of it. Profile waits-1, the five
recording threads: 21 % contended locks, 11 % HostHeap::keep, 17 % readable,
7 % the look-up of buffers, 8 % clocks and counters of ours.

VICTORY_QUICK_FIND=0 and VICTORY_READY_ONCE=0 go back; counters of the
diagnostics by thread, a coarse clock for what is noted per texture and slot.
VICTORY_AB=<s>,<switches> turns switches on and off while the title runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Runs n08 and n11 were lost to page faults in the first texture of a block made that instant: lists on the
card read the slots new textures are put in. 12 empty blocks are made ahead; textures up to a whole block
lie in them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The recording job the frame waits for last (24 of 65 ms, timeline waits-2) is
2,500 indirect dispatches, each with a table of its own that differs in a
constant buffer. VICTORY_AB can turn VICTORY_MAP_THREADS (8 or 1) too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three losses were page faults in a texture made and shown in the last tenth of a second. With the switch the
texture pass, and a draw's table for the title's slots, put a neutral 1x1 texture (or the old view of the same
texture) there until the submission with the upload has finished. The book's report has the piece and its
block, the submissions at the making, the upload's submission, and what the slot showed before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From DexNom/VIctory (GPL-3.0-or-later) bc3cd4b0 and 5f4c3df4:
- DispatchX's flag 0x20 says the counts are threads (bc3cd4b0). Taken for
  groups, a rehydration stage ran up to 64 times its threads and stored over
  the structures after its own. The lanes past the count leave at once, in
  every builder program of one dimension without a group barrier (there: in
  two, by digest). VICTORY_THREAD_DIMENSIONS=0: as before.
- A child that is not there may have inverted infinite bounds: it was entered
  at minus infinity, came first and ended the walk (bc3cd4b0).
- A node in a page without a copy reads zeros, a child and a box: no hit
  (bc3cd4b0).
- Signature rows in the order of their names; vertex outputs interpolated as
  the title's PSV0 says; an unread input packed beside a per-vertex one is
  constant too (5f4c3df4), with their tests.
Every shader is translated again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- VIctory da82e444: the host's division was a step off for some codes, and a
  material index cut from one was the code below.
- DexNom/VIctory 921d8d3b (its cube part, with its test): the level was taken
  from a natural logarithm DXIL does not have, 1.44 times too high; the
  instruction's least level was lost.
- VIctory 4243a96a, for buffers a program picks from the heap.
- VIctory a1a2077a.
Every shader is translated anew.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
White on black in the upper left corner of what is shown, twice a second, from the
counters of the frame-rate line, memory and textures; our own 5x7 characters. Copied
onto the swap chain's buffer out of a buffer in the card's memory: screenshots carry
it, saved frames and the frame recorder do not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's 45,000 to 60,000 list calls a frame append their arguments to a
stream; threads of ours translate it, several lists at a time, and the line of
submissions goes on with a submission when its recordings are translated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its threads take turns through atomics; what one wrote before its atomic has to
be seen by the one after it. The console's waits for writes are not in the
translated code. After beloooo's 72e748ea (VIctory-Belobug-AMD).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title reads a new structure's compacted size a frame or two after it asked,
takes memory of that size and copies the structure there. It read the size the
slot held before: the copies wrote over their neighbours (run light-11).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After beloooo's constant (VIctory-Belobug-AMD 06031237, 4f45ab88, cd9f78ce).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The thread that runs the line takes the Run entries that follow in the queue along, with
the waits they meet themselves and the signals between them (the idea: fxceless/victory-fork
39731795), as long as nothing of them reads on the CPU what those before them write; what
they refresh is brought up to date in one go in front (VICTORY_REFRESH_FRONT on its own:
measured at nothing); each part still goes to the queue in a call of its own.
Run submit-1, the dorm: 12 of 28 parts joined, 54.8 -> 51.4 ms a frame of that thread.

A copy at its place in a list is in the way of fills done on the card only from its place
on, and the submission is cut behind its list for those (opening, run n19: 40-60 ms a frame
of the submitting thread standing). Not seen in the dorm; not measured yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A book of the faults (VICTORY_FAULT_BOOK=<file>, diagnostics) says of the
dorm: 586 faults a frame on 900 blocks, 245 of them on a block that had
faulted in the same frame already, 220 within 3 ms of the refresh that made
the block read-only; 69 ms a frame of the title's threads, of which 6 with
the guards' lock and 63 waiting for it. What is held under it is mostly
VirtualProtect (5 us and more in the game's process, one at a time whoever
asks: a bench found 14 threads no faster than one).

- A block a write fault opened is left open by the refreshes of the next
  3 ms and told as written at each.
- The other views of its page stay read-only, not clean.
- The sets of guarded, clean, absent and aliased blocks are bits, a range is
  looked at by words; the lock is let go between the runs a refresh guards;
  a fault that finds its block open takes no lock; the record of the title's
  views is read by many threads at once; the kernel is not asked about memory
  known to be a guarded view.

Run faults-2 (A/B of both switches, 20 phases of 10 s in the dorm): faults
601 -> 391 a frame, blocks made read-only 928 -> 407, the title's threads
27.5 -> 15.8 ms a frame in them (69 before), frame 64.8 -> 62.5 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's streaming thread spends 400 to 750 ms of a second in mapping calls
in the world's first minute (runs stream-1 to -4; DirectStorage itself answers
in 1 to 8 ms): each call waits a millisecond or two in the host's queue behind
the guards' protection changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first run after a new translation (textures-d2: 2,500 pipelines being made,
594 draws a frame dropped in the world's first minute) had no lamps and no
colour in the shade to its end; the second (textures-d3) had them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FPS, draws, the submitting thread, the card, waits, recording, MB a frame, memory; its own
microseconds a frame on the submitting thread. VICTORY_PLACED_ORDER can be one of
VICTORY_AB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diagnostics: per copy what goes up and what is fetched (every five seconds, the eight that
move most), and the protections title memory is asked for with (write-combined and GPU bits).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Most of what faults is the runtime's memcpy (a third by time) and single
stores into objects that lie in memory some copy covers: flags, reference
counts, links of free lists. The bytes are put in through our own view of the
page, the block told as written at every view by a bit that the next asking
takes: no protection changes, for the write or for the next taking.

Copies: the title's imports are ours and look at the blocks' bits. Stores:
the instruction that faulted is decoded and done in the handler. Too many to
a block, or code that fills blocks: opened as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's v_max/v_min (seven host operations each, for the order of the
two zeros), v_mul_legacy (a product, two comparisons, an or and a select;
two thirds of all products of the lighting program), v_med3 and v_fract are
written as the one operation the driver makes the same instruction of, where
the host is an AMD card with waves of 32 and 64. Checked on the RX 7900 XTX
against the spelled-out forms with zeros, infinities and NaN (a legacy
product's zero may have the other sign).

RX 7900 XTX, yard capture replayed turn by turn with and without (12 loops
each): dispatches and draws 18.41 -> 17.58 ms, the lists' 29.2 -> 28.4 of a
36.6 ms frame; 0.4 of it without the legacy products. The picture is the same
(79 dB; two replays of one set differ by 68). A product that is only a
product would give 0.65 ms more and NaN where the console has 0.

Measured and left out (nothing): v_mad as one multiply-add, fast
reciprocals, scalar loads of four dwords at once, buffers picked from the
heap read without asking for their kind (0.12 ms), a wave size for every
compute program (32: +0.26 ms, 64: +0.1, the console's: +0.1), no barriers
at all (0). Changes the translator: every shader is translated again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
--shaders after local/models 098ec1d4. The capture's 1,266 containers are
collected from the title's files once (beside the capture) and translated by
this build in 15 s; a pipeline that is refused with them keeps the recorded
ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A submission whose lists are still being translated is unfolded where the
one before it may take it along.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A structure that was written over names gigabytes; the builder's copy of it
(CopyForBVHUpdate, 63 a frame in the dorm, 13.3 of 84 ms in the timing run
light-13) went through all other structures' memory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Memory the kernel watches counts as written by the landing of what shaders wrote; the next
refresh copied those pages and sent them up again (run submit-2, the dorm: a copy of 90 MB,
write-combined for the title, 14.9 MB a frame fetched and 14.4 MB of the same pieces sent).
Pages a landing was noted in are compared with the CPU side, 4 KiB at a time, and left if
they are alike. Not run in the game yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A store that faults, or a part of a copy into a guarded block, whose bytes
are there already is left out (with VICTORY_STORE_BESIDE, VICTORY_COPY_BESIDE).
The places in the title's code where that is the rule and the instruction is
an `or` of a byte with a constant are written into the file, and made to look
before they write at the next start. The file holds offsets, no code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Yard capture, 423 passes a frame, turn by turn: 1.93 -> 1.69 ms (4 loops;
four at once 1.70, sixteen 1.71).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every pipeline the title creates goes to known-pipelines.bin beside the
pipeline library, its containers to known-shaders.bin (in the cache folder;
they are the title's code). `victory warm` makes their host pipelines in
idle-priority processes of 200 each and lets them go: the driver's cache on
disk keeps them. Those earlier runs drew with come first; what is done is
noted by translator and driver (warm-done.txt); a pipeline that ends or
hangs its process is named in warm-bad.txt and skipped. VICTORY_EARLY_ALL
does this in the running title and ended it inside the driver.

Not measured yet: how long, and how much the driver's cache grows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit a50c7fdeb5.
VICTORY_UNDER_WIDE=0, VICTORY_UNDER_THREADS (6), VICTORY_FAST_CORES=3 (as before: all of them), VICTORY_WIDE_SPIN=<us> (0: off).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run shaders-1, the first with a changed translator (fresh shader and
pipeline caches): 3,020 pipelines started at creation, all 16 workers in
programs of seconds to tens of seconds each while the title loaded (97 made in 20 s),
then the quick ones at 100-190 a second, too late: 0.5-1.6 s a frame and up
to 2,900 draws a frame dropped from 60 to 150 s. A pipeline that took a
second is now noted (slow-pipelines.txt; `victory warm` notes them too) and
waits in a list of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A page shown at several addresses, and one more view of it being mapped: the
views that were to be opened were looked for before the lock was taken, so one
made clean in between stayed clean with a writable view beside it (a write of
the title's through that one was not told until its block's next told write),
and they were opened one range after another, so for some microseconds one was
writable while others were still known by their bits (told one asking late).
Both are older than the faults' work; VICTORY_OPEN_ONE_VIEW made the first
common. Also: what is known by its bits is not where bytes were just put in
beside the guard (VICTORY_COPY_BESIDE, VICTORY_STORE_BESIDE).

The test of writes through other views failed in 6 of 200 runs, then 4 of 380
with the first mended, 0 of 603 (four tests each) with both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A page shown at several addresses, and one more view of it being mapped: the
views that were to be opened were looked for before the lock was taken, so one
made clean in between stayed clean with a writable view beside it (a write of
the title's through that one was not told until its block's next told write),
and they were opened one range after another, so for some microseconds one was
writable while others were still known by their bits (told one asking late).
Both are older than the faults' work; VICTORY_OPEN_ONE_VIEW made the first
common. Also: what is known by its bits is not where bytes were just put in
beside the guard (VICTORY_COPY_BESIDE, VICTORY_STORE_BESIDE).

The test of writes through other views failed in 6 of 200 runs, then 4 of 380
with the first mended, 0 of 603 (four tests each) with both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Queue: passes over the screen first (local/next), then what draws asked
for, the early ones, and those known to take long by a quarter of the
workers. start() woke one worker, which could be one of the two that take
passes over the screen alone: the pipeline then waited for the next push.
All are woken now. victory warm goes through the pipelines no run drew with
in no order, 40 a process. victory translate: VICTORY_HOST_RDNA=1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatches declare the same few ranges again and again: 4,003 to 5,550
steps a frame of fork-b1-fast, each a flush of its copy's pending refreshes
and two locks on the thread that submits (the snapshots alone 1.7 to 2.0 ms
a frame). The ranges and their order stay what they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two queries for an interface, three locks and a name looked up at every
change of pipeline; now one lookup by address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Until the list next writes title memory, as for refreshes: up to 64 KiB of
fill less for every repeat. How often this title binds one was not measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Theirs compares the handles, which a title may write other views behind;
here the views themselves (resource, host texture, description) are compared.
A call with the same ones saves a host view per target and the driver's call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Belobug (76387c2d) found draws flickering because the records past a list's
budget were not the same ones from frame to frame. Whether ours are refused
is not known: the count says it (atomics only when there is something to
say). Off by default; the records' order and costs stay what they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What 53abe45a ("wip wide") brought in: opt bit 64, smem's loads through
raw_dwords, its test and switch test as they are there (the global loads of
this tree were wide already). Yard capture, turn by turn: 18.47 -> 18.45 ms
(12 loops) and 18.23 -> 18.16 (5): nothing, so not on. With the bit off the
code written is that of before.

Not run yet: scalar_buffer_loads_read_the_same_dwords_one_call_or_four and
the gpu tests on the second merge of local/next (2be0515c); the diagnostics
build of 393e74fb finished.

Belobug ae75a66a is this tree's own opt.rs (both from the fork at ba8697aa)
without its first-lane pass; 7263339c is a trace: nothing to take.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A console wave64 program with LDS in a group over 32 threads runs on a
32-lane host as two host waves that meet at group barriers on the edges of
each lane-branch region. A region that both reads and writes LDS was
refused, since a read inside it may miss the other half's write.

That changes nothing the region leaves behind when it only raises a flag:
every access is a ds_read_b32/ds_write_b32 at a constant address, every
write stores the same constant, at most one address is both read and
written, every write a lane can reach after a read goes to that flag, the
region has no other effect, and no register it writes is live (lane by
lane) where a lane leaves it. A missed write then only keeps a lane going
as if the flag were down, and what it writes is the constant already
there. VICTORY_LDS_FLAGS=0 turns this off.

sr_tracing:CS_Tiling_Generate_Opaque (2cc4c197ee29e291) now translates in
waves of 32 and its pipeline is created on an RTX 5070 Ti. Translating
the whole shader pack for a 32-lane host, it is the only program whose
outcome changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 8bc48bf7eff5017ae2f43cfe55c12c88bfbbad2d)
Adapt the selector and high-performance preference from fxceless/victory-fork#261. Prefer Shader Model 6.6 in the shared path and seed offline translation from the selected adapter.
Title memory has guard pages: stack guards, and guards the title sets up
itself. A copy of title memory (safecopy: victory_safe_copy, _put and
_merge, under the write-catch handler in watch.rs) that touched one got
STATUS_GUARD_PAGE_VIOLATION (0x80000001), and the OS cleared the page's
guard flag. on_write sent every fault inside a copy to the copy's failing
exit, whatever the code, and nothing set the flag again. The page stayed an
ordinary page, so the title's next touch of it no longer raised the guard
fault it was set up for. Under Proton the process then exits silently 1-3
minutes into a world; a traced run logged two 0x80000001 among three
million access violations. That the lost guard causes the exit is the
reading of that trace, not something reproduced here.

A guard fault inside a copy now sets the guard flag again on its page, with
the protection the page has, and fails the copy as before. A guard fault
outside a copy still goes on to the next handler (CONTINUE_SEARCH).

The direct copy (VICTORY_DIRECT_COPY) had the same bug; klbf-lab PR #34
(commit 478c6ef) fixed it there. This is the same fix for safecopy.

Test: safecopy::tests::a_guard_page_fails_the_copy_and_stays_a_guard_page.
Under Proton Experimental it fails without this change ("the guard flag was
consumed") and passes with it.
When a structured view starts on one of its elements but off the raw alignment, use the existing view-relative copy. This covers native NVIDIA descriptor heaps that cannot allocate a second raw slot for every view.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Switching VICTORY_LDS_FLAGS changes the required wave size for the affected shaders. Use the same cache fingerprint path as the other wave64 lowering switches.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The meter's 5 s block (sorting, VirtualQuery, some forty log lines) ran on
the presenting thread, the lane: about 30 ms once every 5 s. It now goes to
"victory-meter" through a channel; =0 keeps it where it was.

ask_ahead's runs (some 50 kernel askings a frame on the lane, 3 ms) can be
asked on the victory-under threads with all held, as before; off until
measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
pLastBreadcrumbValue is the count of completed breadcrumbs, so history[done]
is the first op that had not completed. The old "stopped at command {done}
of {count} (op X)" read like one-based numbering and was mistaken for the
last completed command (issue #22). Say the count, the last completed op
and the zero-based index of the first uncompleted one explicitly, and skip
the detail when the reported count is out of range.

Refs #22
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of avatarmanz/VIctory-7900XTX#14 (itsonewi) asked for three things on
the guard path.

Destination: a copy, a put and a merge into a guard page each fail and leave
the page a guard page. The fix in the previous commit already does this; the
tests pin it. Without the fix they fail ("the copy's fault cleared the guard
flag", the same for put and merge).

Re-arm: rearm_guard checks that the page is still committed (VirtualQuery)
and that VirtualProtect succeeds. A failed re-arm, or a guard fault that
gave no address (NumberParameters < 2), is counted in NOT_REARMED; the first
is logged once as a warning, "guard not re-armed". Test:
a_page_that_cannot_be_guarded_again_is_counted (red against a stub that
always answers true, green with the checks).

Kernel retries: none. With safecopy on, no caller of copy, put or merge falls
back to ReadProcessMemory, NtWriteVirtualMemory, WriteProcessMemory or a
memcpy after a failed copy. The kernel calls are only on the
VICTORY_SAFE_COPY=0 branches (host.rs read and write_mapped). The retries go
through the same safecopy routine again, and each guard fault re-arms the
page. No code change for this.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a GPU with 32-lane waves a console wave64 program runs as two host
waves, and a v_readfirstlane where not every lane runs was refused (the
two halves cannot meet there to give each other their first lane). Three
programs of the ray-tracing structure builder stopped that way, so the
builder (all or none) could not run on NVIDIA at all (issue #4).

They read the first lane of a value every lane of the console wave holds
alike, inside a loop whose conditions are alike in the console wave too:
a prefix over wave totals, `if (id >> 6 != 0)` and lanes leaving at their
wave's own index. Then each host wave can take its own first lane.

lane_uniform now proves that: it runs to a fixed point; an instruction
under a condition whose atoms are compares of alike values (or uniform)
counts, over an old value that is alike too (waves the condition leaves
out keep that); LDS reads at an alike address count; phis count where
every predecessor is reached by whole console waves (past branches on
alike conditions only); and the thread id's x shifted right by 6 or more
is alike where console waves are runs of 64 ids along x. The result is
only used for v_readfirstlane in the two-host-wave form.

Checked: a GPU test of the same shape (256 threads, four console waves)
fails on the old analysis with the builder's refusal and passes with
this one on an RTX 5070 Ti (driver 621.40), every thread getting the
console's sum. Over the title's whole shader pack and the builder DLL
(VICTORY_HOST_WAVE=32), the only programs whose translation changes are
these three (now emitted and validated: compute 2,718 -> 2,721 of 2,734)
and one other builder program, whose first-lane read of `id >> 6` now
skips an exchange that gave the same value. victory-shader tests: 211
passed. In a world run with VICTORY_BVH_BUILDER=1 the builder now runs
(all 53 programs have host pipelines); the title still crashes within
seconds of it, with or without VICTORY_BVH_QUARANTINE, so it stays off by
default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 3f2bcc7f2d79f04dca6d26e32f823a700b1c327f)
(cherry picked from commit 9e24afa06d4d332d432c92680c398b31f59f28d3)
Reuse the control-flow region map during fixed-point analysis. Require all explicit register words and exclude partial LDS loads, GDS and implicit state from the proof. The LDS and operand restrictions draw on adriaespii’s review in fxceless/victory-fork#36.

Validate both a wave-uniform prefix scan and its lane-dependent counterpart and require a compute PSO when the hardware can exercise the wave32 program.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FILL_TITLE=2 (small fills from title memory no shader landed in for 600
frames are done from the title's bytes): run fills-ab3, standing in a
street, A/B by 10 s: mean 88.8 ms a frame against 100.5, median 83.4
against 88.1, p90 104 against 154; fills on the card 20-40 a frame against
900-3,500. Walking (fills-ab1, fills-ab2) the picture held. =0 turns it off.

ASK_SPREAD (fills-ab2): the asking took 6.2-6.3 ms with it, 5.6-5.8
without: the kernel's askings do not go on side by side. Removed.

Timeline spans: "asking: ahead", "asking: the rest", "asking refused",
"steps on the card: whether in the way".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run fills-ab4 (VICTORY_THIN=1, submissions on our thread, A/B by 10 s,
walking): FILL_TITLE=2 60-71 ms a frame against 64-65 off. With it about
one submission a frame waited 8-15 ms for landings for "what a copy at its
place writes": the fills no longer stop blocked_by, which now reaches
place::read_by, and the card's steps take nothing. Off, the card does them.

ask_once holds everything once for both its parts: the second hold waited
for other threads' askings again (0.5 ms a time in run fills-ab3).
VICTORY_ASK_GAP=1 joins ranges up to 24 MB apart into one asking (off).

Diagnostics: the kind of step found reading a placed copy's destination.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shadow::merge_under_writes, for a copy in the card's memory, found the
changed word runs of a page and then copied each run on its own into the
CPU's side: 190,000 runs in 400 pages a frame in session play-1125-1724.
Now each 32-byte block in which a word differs takes the title's bytes as
it is compared (the words of a block that do not differ are equal, so the
same bytes end up there; VICTORY_UNDER_FUSED=0: as before). The copies of
their own a page can need (runs of more than 256 bytes, at most n/260+1)
are taken from what the submission may send up before the pass and the
rest given back, so a page never has to be put back; where they cannot
be taken, the pass is as before. The runs of a range's pages go into the
copy's dirty list in one call, with room reserved.

A frame-rate line says where the time of this step goes: finding the
copies in the lists' refreshes, asking what was written, finding the
pages, waiting for the copy's locks, comparing (wall, and threads
together: reading title memory, comparing and putting in), noting runs.

Measured, city, lane on (VICTORY_THIN=1, JOIN_PARTS=8, UPLOAD_AHEAD=1):
- late-1 (no ray tracing, before this): 7-13 ms a frame on the lane, of
  them compare 3-6 wall (7-16 threads together), noting 1.4-3.6, asking
  1.0-1.7, the refreshes looked through 0.9, locks 0.0-0.2.
- late-3 (ray tracing, A/B of the switch in one run, world phases): 1.96
  -> 1.87 ms; compare and put 0.42 -> 0.27 (threads together), noting
  0.11 -> 0.06; frame unchanged within noise (110-121 ms both).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The structure builder's one-dimensional programs are dispatched by a count
of threads whose last group may be partial (USER_DISPATCH_THREADS_X). On a
host of 32-lane waves (NVIDIA) a console wave64 program that crosses halves
runs as two host waves that exchange through group barriers, so the lanes
past the count cannot leave at entry. `counted_in_threads` therefore skipped
these programs on 32-lane hosts, and their lanes past the count ran: they
counted in wave ops and stored.

Now the lanes stay for the barriers and `partial_active` leaves them out of
memory accesses, EXEC's ballots and the wave's reductions. Shuffles keep the
plain guard (they read other lanes, not memory).

Test: a spilled 64-thread wave64 program with s_bcnt1(exec) and a whole-wave
OR across halves, lowered through `lower::lower` on a 32-lane host; it must
take 32-lane waves and give the console's results for counts 45, 1, 33, 0.
It fails without the change (no USER_DISPATCH_THREADS_X) and passes with it
on an RTX 5070 Ti (Wine + vkd3d-proton).

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Check the previous destination of swaps and accumulators. A conditional select needs a proven uniform predicate, since a scalar bit pattern can select different inputs in different lanes. Leave relative register accesses and operations with an implicit VCC input outside the proof.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
What changed on the CPU's side of copies in the card's memory goes to a buffer of
ours in the card's memory on a copy queue of its own; the drawing queue waits for
it by a fence and copies from there, at the same place in its order as before.
The host list's D3D12 list is a Rec: state changes, aliasing and the title's
barriers wait there and go in one call at the next use of the list (every use
goes through its Deref). Replay of replay5: the PC-to-card copies 5-6 ms of the
drawing queue; joining barrier calls -2.4 of 79.5 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run card-ab1 showed the up queue unused: with VICTORY_SEND_OWN on, the bytes go
from the submission's own memory, not from the copies' CPU sides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adapt the far early-out and deep scalar-copy parts of fxceless/victory-fork#1002. This tree already tracks parked scalar pairs by lifetime. Retain that implementation and bring across the synthetic regressions, including the hardware gate.

Adapted from eaeb8f173a

Co-authored-by: Bruno Magalhães <[email protected]>
Run lane2-0: two write-watch askings of 11 and 13 ms on the submitting
thread each ended with one of the memory map walk's VirtualQuery calls
(16.6 and 13.1 ms, thread victory-memory-map); the walk asks about 250,000
regions in 0.9 s every 30 s and holds the process's memory map meanwhile.
Run ask-1 without it: no asking over 1.5 ms on that thread in 50 frames of
five timelines.

The 5 s lines' VirtualQuery for the kind of each busiest range (10 ms on
the submitting thread in lane2-0) is asked once per address.

Diagnostics: ranges a submission's asking asks about alone (askings, pages
found, time), the costliest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Checked every VICTORY_* name in the Markdown files against the source.
One was dead: VICTORY_MERGE_RACE (its counter was taken out after
8dd30ab); the line keeps the finding and drops the switch.
VICTORY_LATE_WAIT (host.rs late_stage: 1, 2, 3) and VICTORY_WIDE_REFRESH
(host.rs wide_refresh: 0, 1, else on at four or more CPUs) are read, as
documented; VICTORY_LATE_WAITS in frame.rs is a different switch.

What the docs had wrong, by the code:
- VICTORY_RELAY (stage 2), VICTORY_LATE_WAIT (stage 3 with the relay)
  and VICTORY_WIDE_BACK are on by default, not off; the frame-rate line
  says these are now the defaults (#34 copied it and saw no change).
- VICTORY_CARD_ROOM_FOR_BUFFERS is on by default (=0 as before).
- VICTORY_PAGE_WRITES opens the guards by default (=0 counts only).
- VICTORY_CARD_BUFFERS_MIN_KB, when above 0, wins over _MIN_MB: said
  in both places that name them.

xtask: a test that every VICTORY_* name in a tracked Markdown file is
quoted in at least one Rust file outside xtask, as every switch is read.

Fixes #49

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The file holds places in the title's code, which is game-derived, and was
opened wherever the variable pointed: with scripts/play.ps1's working
directory a relative name landed in the checkout, and cargo xtask policy
accepts a small .txt of that shape. The path now goes through
victory_core::ensure_outside_repo, as every other writer's does. It is
looked at once, on the thread that writes and not under the title's fault,
and kept in a OnceLock: a refused file is said once with a warning, and no
thread is started for it again.

victory-gpu depends on victory-core directly now (no cycle: victory-core
has no workspace dependencies, and it was already built through
victory-pipeline).

Fixes #33

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The per-second part of the meter took about 3 ms on the submitting thread
(run ask-1). VICTORY_METER_THREAD=0 keeps all of it there.

Built and tested (329 victory-gpu tests pass); the A/B run ask-3 was stopped
before the game ran (the user plays).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #29
Suggested by sharan104 in #88.
Every device loss with the pool in the report (n08, n11, n15, steps-ab2,
start-3, the user's play-1125-2107 without ray tracing) was a page fault
at the first byte of a texture in a block made that millisecond, its title
slot changed "at once" (mirror) while lists sent before read it by index;
VICTORY_SHOW_AFTER covered only some paths. mirror() now holds such a slot
on what it showed (or the neutral texture) and flips it when every
submission begun before the texture was made has finished.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport the capture conversion and regression test from fxceless/victory-fork#910.
With VICTORY_GPU_TIMING each list runs and is timed on its own, preludes and
the compare of copies in the card's memory included, and the frame line sums
them: the title's lists (their noted commands and the rest), preludes, steps on
the card, compares, others of ours, and the least a list took.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Whether the submission's asking holds a range was asked two or three times
per refresh (10,000 a frame), each a walk through all its ranges (a few
hundred). They are now kept by their starts with the furthest end so far:
the same answers in a few steps.

Measured and left out (run ask-3b, A/B in one city run, no ray tracing):
VICTORY_ASK_NORESET lane asking 7.2 ms a frame against 5.4 off, kernel
3.7 against 4.4 ms; VICTORY_ASK_SPREAD kernel askings 17 ms against 4.4
(they wait for each other in the kernel), lane 6.5; both 8.1 ms and frames
74 ms. Both stay off.

Tried and dropped (run ask-4): askings within one reservation only (the
refused askings stayed at 280-300 a frame: they are not the ahead runs'; and
VirtualQuery of the pieces stalled the lane 100-1100 ms every 5 s), and
askings of the refreshed ranges only (they are 99% of the copies' spans).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tests: victory-gpu 330 pass. Replay of captures\replay5\capture-1 (3 loops)
ran to its picture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #30
The executable's three debug-text shaders (TextVSQuad, TextPS_Tex,
TextPS_Sdf) carry their FSSM blob unpacked, under XDAT kind 0x0c
instead of 0x0d; they were read as containers without a program.
All three now translate and validate. `victory shaders --list <file>`
writes every shader that does not translate, one line each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ray-traced shadow tracers (CS_TraceShadowRays_*) take their
structure's address out of an SRV they pick from a table by an index
from a constant buffer, read its header at +48 and build the BVH
descriptor themselves. Only views at a fixed table place had their
address from the host (USER_VIEW_ADDRESS); these were refused as a
descriptor read only as data.

The host's table of strides by view heap slot (root SRV t255) now has a
second part after the strides: per slot the title address of the buffer
view or ray-tracing structure there (VIEW_ADDRESSES, two dwords, entered
where the stride is). Such a load reads dwords 0 and 1 from there;
dwords 2 and 3 stay without a value (a program that reads them still
stops). Pages the address reaches are found by the existing fault notes.
Four of the five tracers now translate and validate (FullAdaptive stops
later, at a lane mask).

shortcut: tables made afresh in dynamic slots have no entry (read 0), as
for strides; dword 1 holds the address bits only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's routine at image+0x1e86440 reserves 185 MB of graphics memory
below 4 GiB, splits it into five pieces, takes all their physical pages
in one XMemAllocatePhysicalPages and maps them in order: one stretch of
one section. Its 174 MB buffer at 0x34e10000 (the ring of constants, and
what the skinning passes write through one view of all of it) had a host
copy in the card's memory, ~17 MB a frame sent up in ~600 pieces, shader
writes fetched back and compared, and ~6,000 constant fills a frame.

With the switch the stretch is mapped once more at an address of ours and
opened as a host heap there (OpenExistingHeapFromAddress1); title buffers
and windows in it are buffers placed in that heap, the existing in-place
form of a host copy: nothing tracked, sent up, fetched back or compared.
The title's own views stay free to change; when it maps other pages
there the region is forgotten. A line on the frame-rate report counts
the CPU fills and buffer copies of ours that still read or write it.

Replay (play-1125-0127, heap in the PC's memory): the title's own work
+~3 ms on the card; the 30 ms added there are our compare passes, which
do not run over memory in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
DXIL wants one interpolation mode per signature row; the console packs a
nointerpolation float beside an int or a system value (the front face)
in one row, and our signatures declared the float linear: 48 pixel and
mesh programs were rejected by the validator ("interpolation mode that
differs from another element packed into the same row"). Float elements
nothing decides (unread inputs, outputs) now take the mode the row's
other elements agree on: same_mode_per_row from VIctory 13091f6e, ported
by hand (the whole commit conflicts in 18 places with what local/next
already took of it). All 48 now validate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
image_get_lod of a 2D array passed the slice as CalculateLOD's third
coordinate, which DXIL wants undefined: three pixel programs
(PS_DeferredTextured_AlphaClip, PS_MirrorReflectionDeferredTextured_
AlphaClip, PS_VfxVBuffer_AlphaClip) were refused by the validator
("out of bound coord must be undef"). The level does not depend on the
slice, so the result is unchanged where a driver took the module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run port1-1: the title maps the five pieces of its 185 MB heap in another
order than their addresses, so the heap was views of one section in a
scattered order ("not one stretch of a section: Scattered") and nothing
was placed. With VICTORY_PORT_CONSTANTS=1 xmem now gives the page numbers
mapped into a 32-bit graphics reservation the slices at their offset in
it, when the reservation is all one section and both slices are fresh
(never mapped or written: no commit bit), which the title cannot observe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run port1-2: nothing was arranged and the heap was still scattered. The
title reserves it with kind 0x42000 (reserve, 0x40000), without the
64 KiB page bits, so it was not taken for a placeholder and was never
recorded. Any 32-bit reservation without commit is recorded now; the
test reserves the way the title does. A warning says once why pages
mapped there are left where they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e278bc8091a0cb61a100caef6dff646d4b3b9e6f)
(cherry picked from commit 25b1bf3b5fa5f27998b3b3bcfaad58c79fef7423)
members() tested all 385 register slots to return the few that are live,
twice for every block of a program: 1.27 M tests for a 1,651-block
shader. Walk the seven set words by their lowest set bit instead, in the
same register order. The IR build is 4.5% faster on a synthetic GFX10
program of 12k and 24k instructions, and range::build 4.1% faster.

Co-authored-by: slatefield <[email protected]>
(cherry picked from commit 129a9ba2d5bed98004e373aa49804734ed0882ee)
Extend bfe_signed_and_unsigned_match_rdna2 in valu_tests with scalar unsigned s_bfe_u32 (SOP2 0x27), literal src1 operands, ignored src1[15:5]/[31:23] bits, 7-bit widths >= 32 (32, 64, 127), v_bfe_u32 5-bit width wrap, and SCC conditional selection for both s_bfe_u32 and s_bfe_i32 (#803).

(cherry picked from commit 23446978c24640c10a0fe3c6e94d8e097e48a914)
CS_TraceShadowRays_FullAdaptive reuses SGPRs between saved lane masks
and constant-buffer fields: a join of a mask and a number (lowered as
the number it is) is cut with s_and_b32 / s_or_b32, which
structurisation takes for lane masks, and the result is compared per
lane as a number. Its ballot holds lanes outside EXEC, so the program
was refused ("a lane mask holding lanes elsewhere read as data").

Such a read now takes the number the bit operations compute from their
operands (constants, root constants, values lowered as numbers, such
operations again; console lanes only, where the joined mask is the
console's number). Only on a second try, as first halves of
interpolations: with it on for every program, 69 compute programs that
already translated came out changed (CS_RaytracingResolve, ...); now
none does. `victory translate` makes the same second tries as runs
(emit_with_retries). FullAdaptive now translates and validates.

The test runs the joined register through both paths on the hardware
device (WARP takes no declared wave size); it found that a join read
only through such operations must be marked read, or its mask's edge
brought 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's placed shader-visible view heap is its frame allocator's memory
(image +0x4d9f400); draws' and dispatches' tables are filled by six 32-byte
stores in +0x4d9efd0 and +0x4eec8e0. With the switch, the launcher patches
those stores (original bytes checked, a site that differs is left alone and
logged) to jump to code that does the store and marks the slot and its 4 KiB
chunk in maps of ours; our own mirroring marks too. sync_heaps takes the
marked slots in place of the write watch's changed pages. Fallback: every 8
frames the watch is asked, and 16 of its pages a frame are looked at whole;
a view record no mark told of is made, counted and logged with the place in
the title's code that last faulted on its block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every rebuild of the translator translated every shader again into a
new set of entries (the key held the BLAKE3 of the translator's
sources): 16 GB of sets of earlier builds in victory-fork-cache\shaders.
The key is now victory_shader::TRANSLATOR_VERSION (bump it with any
change of what the translator makes), the entries' format and the
settings, plus the container: a rebuild that leaves the version keeps
every translation, and the store grows only by shaders that newly
translate.

Each entry (VSH2) also names the translator build that made it. An
entry of an earlier build is served as it is (counted, said once in the
log); `victory shaders` translates such entries again in place and
prints how many came out different, which tells whether the version
should have been bumped. VICTORY_SHADER_FRESH=1 refreshes in a run;
VICTORY_SHADER_KEY=source keys by the source as before. The pipeline
warm-up's fingerprint follows the same key.

Checked: all shaders translated into a fresh cache (25,790), then the
translator rebuilt with a comment added: 25,790 entries refreshed in
place, 0 different, no new files. Entries of the old key (VSH1) are
not read and not deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run port2-2's fallback found ~250 view records a frame on its 16 pages that
the six patched stores had not told of; the runtime's memcpy was among the
last writers of their blocks. With the switch, the title's memcpy/memmove
imports mark each slot of the marked heap whose first word they copied is a
view record's. The fallback now also says how many of the missed records a
draw read through a table lately (made by the draw anyway).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham): compose.rs (two planes drawn as one,
the second premultiplied over the first, each scaled to the screen),
Host::present_planes, the second plane read at the retail PresentX
stride of 72 bytes and checked to be a resource of ours, the overlay
carried through the submit lane's present job. Barriers from and to
COPY_SOURCE are left out when the texture is in it already.

Off by default: without VICTORY_PLANES=1 the first plane is shown alone
as before. Either way the first present with more than one plane is
logged once with what its second plane is. Left out of the fork's
commit: WakeByAddressAll on memory writes (the title never waits with
WaitOnAddress; only our threads do).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham). TablePlan: what a shader's descriptor
tables hold (slots, CBV/UAV, last dword, entries by descriptor) is
grouped once when the pipeline is translated, not searched in the
declarations at every bind (State::tables). Same tables made, same
order of entries.

Fallback heaps: with VICTORY_FALLBACK_HEAPS=1 a list always has a view
heap and a sampler heap bound, a host heap of one slot (a null view, a
point sampler) for the one the title did not set, as a root signature
with directly indexed heaps wants. Off by default: only the heaps the
title set, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The IR can retain an old destination on ordinary instructions that overwrite it. Only require implicit VGPR values on swaps and accumulators, where lowering consumes them.
Separate renderer-side shader translation and lock acquisition from D3D12 load and create calls. Also trace first-use waits and library serialization so a Present dependency trace can attribute worker time with the existing diagnostics.
From codec-d/cool_fox (641835a4, fabb872a, c64fc9b4, 08e4574d, e94d277a,
the values of the last): residency.rs asks the system's memory once a
second (the sweep). Under pressure (3 GiB of free RAM or 4 GiB of commit;
out again above 5 / 6) texture prefetch is limited to 64 MiB a frame,
idle scratch chunks are let go and the texture and staging pools keep
fewer empty blocks; below 1.5 GiB of commit 16 MiB a frame and no
spare staging block; the texture pass stops below 512 MiB of commit and
no new staging block or upload-ahead is made for textures picked by
index below 1 GiB (those a draw samples still get one). With 32 GiB of
RAM or less (or VICTORY_RESIDENCY_LIMITED=1): 128 MiB a frame, 32 MiB
on its way ahead, 16 submissions before objects are let go, fewer
spare chunks. Off by default.

Always (only after a failure): a pool whose new block was refused does
not ask again for 500 ms (it still uses its blocks), and an
E_OUTOFMEMORY from an upload buffer, texture heap or host texture stops
the texture pass for 500 ms, leaving its slots due. Tests from the fork
for the back-off and the reclaim.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham). What the bindless buffer pass keeps of a
view heap (its passes, the ranges of its slots, and for
VICTORY_UNWATCHED_FRAMES > 1 the last refresh of each unwatched copy with
the span it covered) now lives on the host heap, so a heap made at the
address of one let go starts afresh instead of taking the old one's
ranges. With the default interval of 1 nothing else changes.

VICTORY_SWEEP_PER_HEAP=1 (off by default): the pass runs once a frame for
each view heap, not once for all of them, a list holds each heap's table
of strides by its own key, and a pass put off to submission time is left
out if the heap at that address has another table by then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham). VICTORY_XMA_REFILL=1 (off by default):
an XMA voice that ran out of input goes on when the title gives it a
valid buffer again, and the pump publishes only whole blocks (but the
padded tail) after at most 8 decoding steps. (The fork clears 6 bits at
word 2 bit 26 where the field read is 5 bits; 5 here.)

VICTORY_DSTORAGE_STAGING_MB=<n>: the DirectStorage staging buffer is at
least that big; unset, what the title asks for (32 MiB). The fork makes
it 256 MiB by default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From codec-d/cool_fox (Graham): the COPY_DEST -> NON_PIXEL_SHADER_RESOURCE
transitions after the card's copies of dirty ranges are made once for
each buffer; two shadows in one buffer gave two transitions of the same
subresource in one ResourceBarrier call.

Tests: victory-gpu --lib 343 ok, victory-hle ok, victory-shader --lib
286 ok, victory-loader --lib 42 ok.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a Ryzen with two core complexes of which one has the stacked cache
(7900X3D, 7950X3D, 9900X3D, 9950X3D) every core reports the same efficiency
class, so `fast_of` found no fast cores and no thread of ours asked for
any. Where the classes are alike and the last-level caches differ in size,
the sets on the largest one now count as the fast ones (at least eight of
them); processors with two kinds of cores still go by their class, and
those whose caches are all alike are left as they were. In diagnostics
builds `VICTORY_AB` can switch it while the title runs.

Measured on a 9950X3D + Radeon AI PRO R9700, diagnostics build,
VICTORY_AB=20,VICTORY_CACHE_CORES, 10 pairs of phases of matched draws
(within 15 %): median frame -1.3 % (noise), p90 -12.2 %, better in 8 of
10. In the steady part (about 3,900 draws) every phase with it had a lower
p90 (69-79 ms) than every phase without (81-86 ms).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-shader/src/emit/wave64_tests.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-shader/src/emit/wave64_tests.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-shader/src/emit/wave64_tests.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/translate.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/warm.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/main.rs
#	apps/victory/src/translate.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	docs/README-fxceless.md
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title asks for 33,333 us (SetFrameIntervalX) because its graphics
settings hold a frame rate of 30 (settings +0x210): +0x1e0fb30 and
+0x22434a0 turn it into a frame time (+0x98f84ac), +0x247ab10 picks the
interval from it and the display's 60/120 Hz (a 120 Hz mode alone changes
nothing at 30), and +0x120530 is a QueryPerformanceCounter limiter of its
own at the same rate.

VICTORY_FRAME_INTERVAL_MS=<ms> (16.667, 8.333, 0 = no wait): frame.rs ticks
at that interval whatever the title sets; the loader makes the two loads of
the setting "mov eax, rate; nop" (rate = 1000/ms rounded, 0 = the title's
own "no limit"), with the original bytes checked. VICTORY_TITLE_FPS=<n>|off
overrides the rate or leaves the title alone. Diagnostics:
VICTORY_TIMER_LOG=1 logs the title's timers once a second and frame pacing
bands every 5 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run fps-1 (our clock at 16.667 ms, the title left at 30): the menus ran at
16.7 ms until the title's own limiter came up at 30 s (then 33.3 ms), and
meanwhile five of its seven timers stepped 33.3 ms a frame: game time ran
at twice the wall clock. The timer update (+0x2226040) takes the real time
since the last frame but at least 1/rate (+0x6849844), and that rate comes
from +0x2241fd0, a third read of the same setting. It now returns the rate
asked for (1000 for no limit), the original bytes checked first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- lightprobe.rs (VICTORY_LIGHT_PROBE=<csv>): a line a frame of what the
  title's exposure (PS_CalculateExposure) and lux factor
  (ComputeLuxCompressionInfo[Smooth]) programs read and write, and of the
  stand-in for the indirect light (its slow mean; the sampled mean of the
  title's resolve, the estimate and what was written).
- texlate.rs: how long textures take to be shown (slot written to
  uploaded, with or without waiting for memory; upload to the slot showing
  it; first part view to whole level 0; last look that found memory away
  to the upload), a line with the memory lines.
- ambient.rs: VICTORY_AMBIENT_SETTLE=<ms>[,<jump>[,<fresh s>]]: the slow
  mean of the light around (20% of every pixel's estimate) follows by a
  time constant instead of 0.04 a frame (25 frames: 2-4 s at 7-13 fps),
  takes a change by more than <jump> at once, and optionally bounds the
  title's leftover by the estimate for <fresh> s after such a jump.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- texstore.rs: a texture uploaded whole from level 0 is kept (memory, up to
  4 GB, and the folder) under keys of its shape and the digest of its
  smaller levels (>= 32 KiB of them, the start of its memory). A texture
  later first viewed from such a level with those bytes gets a whole host
  copy: the larger levels are copied from the store by its first upload's
  list, and its views show from level 0.
- draw.rs heap_textures: the backoff of looks at slots whose memory is
  away was 'about four seconds' counted in passes (several a frame): up to
  256 frames, 13-18 s; VICTORY_TEXTURE_LOOK_MS=<ms> caps it by frame time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/draw.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title takes its output size from its settings (settings.xml video/resolutionFullscreen,
3840x2160 as a Series X wrote it) and applies it at +0x224352b (+0x22434a0) through the one
screen size setter +0x2478130; the back buffers follow (+0x247ad10). VICTORY_OUTPUT=<w>x<h>
(one of the title's own modes) makes that block write the size into the settings, then take
the title's own path. VICTORY_RENDER_SCALE=<0.5..1.0> replaces the title's own upscaler's 2/3
(+0x28f1e78) and FidelityFX's scale (+0x28ef680, as pull request #53); VICTORY_UPSCALER=<6|7>
is pull request #53's picker patch (+0x7e93f0). Each site's bytes are compared first; another
build is left alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title makes its back buffers in a 64 MB pool (Series X) and stops at an int3 unless less
than 2 MB of it is left over; at 1920x1080 49 MB are (run res-1 stopped there 2 s in).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Heaps are made without sharing across adapters, so the resources placed in them
cannot ask for it: the buffers renderer port 1 places in the heap opened from the
title's graphics memory (and every other heap opened from memory) were refused
("parameter incorrect", 1,326 to 3,576 a capture). With `--timing detailed`, a
list that runs no shader but ours (the host's state preludes, copies of what
the CPU sent up, the card copies' passes) has its commands summed under
"... (lists of ours)".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console takes constant buffers on 16 bytes, D3D12 views on 256, so every
constant buffer a draw's tables name was copied at each submission into upload
memory of ours (~23,000 a frame of the city, ~9 MB, out of the title's graphics
memory that renderer port 1 already has the card read in place), and each root
one not on 256 bytes (64 KiB each).

With the switch, translated shaders read constant buffers as raw bytes
(victory_shader::emit::constants_raw): a table's (or one picked from the heap)
through the raw twin of its slot, a root one as a root SRV. The host makes a
table's constant buffer in title memory in place a raw view of the title's
bytes in that twin (descriptor::host::constant_raw_at): no copy, no step at
submission. Others are copied as before (their twin is a raw view of the copy);
a title slot's constant buffer view gets a raw twin (a raw read through a
constant buffer view has no end on AMD). The shader cache keys on the switch
(only when on: translations cached without it keep their key, so the
translator version stays). VICTORY_PORT_CBV_PLACE=0 copies again while reading
raw; with VICTORY_AB=<s>,VICTORY_PORT_CBV_PLACE both sides in one run.
Per-second line: "renderer port 5 (VICTORY_PORT_CBV=1) per frame: ...".
Test: emit::tests::table_constant_buffers_read_as_raw_bytes_through_their_twins
(WARP: the twin is read, the slot's own view is not).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Series S renders through FidelityFX (+0x28ef680). With its scale at 0.5 (run res-6) FidelityFX's
jitter phase count came back 0 and the title divided by it at +0x28f03e8, 49 s in. The title's
own upscaler (Series X) ran at 1.0 (run res-4). The FidelityFX patch stays, behind its own switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The sets of guarded blocks are of atomic words and GUARDS is a reader-writer
lock. With the switch a write fault, a refresh guarding its range and a block
made known by its bits take the lock shared and the claims (BUSY bits) of the
blocks they change: faults wait only for whoever changes the same block, not
for one another, and refreshes do not wait for faults. Faults wait for claims
in block order, refreshes only try for theirs (a block they cannot claim stays
written, told so at the next asking), so no two wait for each other. What
changes more than single blocks (mappings, kernel reads, freed memory, holes)
still holds the lock alone, as before. Blocks known as view memory (VIEWS) go
to the guards at once instead of a kernel asking that is refused.
VICTORY_GUARD_HOT=<ms> (off): blocks written again soon after each taking
rest longer. End-of-run line: renderer port 6 per frame.
Tests: three stress tests of the view writes with the switch on (all
threads, half of them, resting and hot blocks).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
One submission a frame spent up to 6 ms in that look alone (run guard-3,
the timeline at 100 s: 5.8 ms with nothing else on the lane) while the six
threads beside it waited; with more than 256 refreshes it was already done
beside them, as each one's first step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run guard-4's timeline: the submission with most of the frame's steps spent
2.9 ms gathering them and 3.9 ms on the spans, alone. Each list's steps are
now folded per copy beside it (fold_touches: the span of its refreshes
before its first write by shaders, whether it writes it) and the folds
joined in list order (join_keys), which gives what front_spans gives of the
whole submission, span for span and in order: front_tests, 3,000 random
submissions of lists, parts, refreshes and writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The heaps' records: a round of the heap-sync thread is asked for when the
title submits, and the lane waits for that round, or for one begun after a
wait of its queue went or a step of ours wrote a heap's memory
(port/lane 97033e5a; its plans part is left out, port 6 plans beside the
lane already).

The journal: the pages' notes are in 64 parts, each under a lock of its
own. With the switch an answer is noted holding the journal shared and its
pages' parts for writing (writes, landed_beside, a submission's asking
before its ranges and number are set alone); what has nothing to change
(wrote with no asking standing, ask_once_end, ask_ahead_done) looks shared
first. A fresh number to answer with is taken holding the range's parts,
switch or not, so an A/B run mixes both safely; a page's note only goes up.

End-of-run line each second: renderer port 7 (heaps' waits with and
without the switch, rounds asked at submit; the journal's waits, the
lane's own among them). Tests: parts and ranges, notes out of order, a
fresh number sees every lower note with no deadlock (8 threads), no write
lost with the switch on in all threads and every other one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run p7-1 (in-run A/B): with part 1 alone the lane still waited 4.1 ms of
5.3 for the heaps' records; 2.4 of 16 preparings a frame found their round
asked earlier. A wait that goes now asks for its round at once (as patch 4's
part 2 did), and one met by the card's own write raises no floor. Counted:
preparings that had to ask at the preparing, and those with no mark.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
views_are_made_beside_the_heap_and_copied_in failed on an AMD card (RX 6600):
it took the bytes of a slot in the heap shaders see to be those made
beside it. Descriptors are the driver's own. On AMD (RX 6600) a copy
into that heap changes them (they name the slot they are in), and the
first 32 bytes of the slot do not change for another view at all. On WARP
they point to an object made anew each time, so a view made again in
place has other bytes.

A copy now passes if it holds the bytes made beside the heap (WARP,
NVIDIA) or those of the same view made in place (AMD), for the raw view
and for the null one after it. With put() made to do nothing, the test
still fails on both the RX 6600 and WARP.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a477ca9a7e3ab1ca1e7c96c39694a610edd0ce42)
Four hardware tests make pipelines that declare WaveSize(32). A GCN card
such as Polaris runs 64-lane waves only, so the driver refuses them with
E_INVALIDARG and the tests fail instead of being skipped, as wave64_tests
and permlane_tests already do for such hosts.

Host::runs_wave32 asks OPTIONS1 for the wave range, the same query
translation_caps makes. run_cases_on and whole_wave_f64_sum_and_cvt_f32_f64
skip a refused pipeline only on a host without 32-lane waves, so a refusal
on a host that has them still fails. partial_dispatch_with_a_cross_half_wave_op_runs_in_32_lane_waves
skips its 32-lane pipeline on such a host, like its neighbour does.

On an RX 580 (driver 31.0.21925.1001, waves of 64 to 64 lanes):
victory-shader went from 298 passed / 4 failed to 302 passed / 0 failed.
Trim whitespace and report invalid values when resolving the host-wave override and its alias before either translate mode. Related to #282.

Co-authored-by: Codex <[email protected]>
- Add explicit type annotations to std::mem::transmute in victory-loader/src/descriptor_sites.rs and victory-gpu/src/host/panel.rs (clippy::missing_transmute_annotations)
- Remove unnecessary &mut borrow in victory-gpu/src/watch.rs (clippy::unnecessary_mut_passed)
- Remove unused diagnostics-only Staging::size field in victory-gpu/src/texture.rs (dead_code under --all-features)
The clean-up pass that gives one instruction for one value (REUSE) merged
a dx.op.getDimensions with an equal one above it. On an RX 9070 (RDNA4,
amdxc64 32.0.32029.2010) the driver's compiler then crashes making the
pipeline (an access violation, always at the same instruction) for 29 of
the title's compute programs, all ped *:CS_RaytracingResolve; the
runtime leaves them out. Keeping getDimensions out of REUSE alone makes
all 29 pipelines; an RDNA2 iGPU makes them either way.

312 programs translate differently, so TRANSLATOR_VERSION goes to 2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The HUD (VICTORY_PANEL=1) took each core's busy share as
(ni - pi).clamp(0, nt - pt). On a Ryzen 7 7700 a core's kernel+user
counter stepped back between two reads, clamp(0, negative) panicked on
the submitting thread, and the run ended (host GPU failure). The share is
now a small function: no time passed or a step back reads 0, with tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use one positive-count parser for translate, shaders, and warm. Exercise all four modes at the real CLI. Fixes #311.

Co-authored-by: Codex <[email protected]>
Keep the launcher default tied to the diagnostic profile and document explicit overrides for a diagnostics-enabled release build. Fixes #283.

Co-authored-by: Codex <[email protected]>
Use the library-loaded pipeline and valid descriptor bindings. Enable an always-pass depth comparison with writes disabled so WARP exercises the same strict bounds assertions. Fixes #314.

Co-authored-by: Codex <[email protected]>
translate --warm took 4 threads when --jobs was not given, while the
flag's help says every logical core and the two other paths of
translate.rs (translate, shaders) do that. The three paths now take
their count from one function, which keeps the at-least-one the warm-up
path already had.
Every host pipeline's root signature carries the directly indexed heap
flags (0x400, 0x800). A D3D12 runtime that does not know them, such as
Windows 10's in-box one, refuses each with "Unsupported bit-flag set";
the card and driver play no part, since serializing is the runtime's.

- At device creation, an empty root signature with both flags is
  serialized once; if the runtime refuses it, one error says that every
  host pipeline will be refused and why, instead of only one warning per
  pipeline as in #168's log.
- The title's own root signatures go to the same host serializer
  (`d3d12_xs!D3D12SerializeRootSignature` and its versioned form). A
  refusal there was passed back to the title in silence: a failure and
  no blob, which the console's serializer would not return. It is now
  logged with the flags and the host's reason. The error out pointer is
  nulled before the host's call, so the blob read is the host's.

Tests: the runtime refuses an unknown flag with the text seen in #168,
and serializes the directly indexed flags exactly when the device
reports shader model 6.6; through the title's entry point, an unknown
flag gives E_INVALIDARG, no blob and the host's reason.

(cherry picked from commit 963abe387e)
(cherry picked from commit 00003e2739)
select_version took only a provider named 4.1.2 and failed otherwise, so
-Fsr4K could not start on a card AMD's SDK offers no FSR 4 for. It now
takes 4.1.2 where there is one and the newest 3.1.x otherwise, and the log
says when 3.1 stands in. With neither, the run stops before the title
starts, names what was offered and says to run without -Fsr4K.

The check after context creation compares against the provider that was
asked for, rather than against 4.1.2.

Tested on an RTX 4070 (Windows 11, Rust 1.98.1) with AMD's signed
amd_fidelityfx_upscaler_dx12.dll 4.1.2.4555 (SDK v2.4.0):
- before: tests/fidelityfx.rs fails, "no FSR 4.1.2 provider for this
  adapter (available: 3.1.6, 2.3.4)"
- after: provider 3.1.6, context made, two frames dispatched
- cargo test -p victory-hle --lib fidelityfx: 5 passed

Not run against the title: FSR 3.1's picture in the game is not checked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The check printed "POLICY VIOLATION" on stdout and returned Ok, so the
command exited 0 on exactly the configuration it exists to refuse, and
a script running `victory config || exit 1` went on. Each violation now
goes to stderr and the command ends with an error, as the commands that
would use the path already do. The resolved values still print first.

Fixes #301.
The profiler walks the stacks of suspended threads with RtlVirtualUnwind,
and a bad RIP or RSP in a sample made it read unmapped memory: the game
crashed after about 4 minutes of VICTORY_PROFILE. With
VICTORY_UNWIND_CHECKS on (the default), each step first checks that RIP
is in executable image memory, that the unwind records and the stack span
they describe are readable and inside the thread's stack, that the PC is
not on an epilogue instruction, and that RSP grows. A record it cannot
bound ends the walk. The leaf rule is kept for the first frame only, also
in our own VirtualAlloc'd stubs. VICTORY_UNWIND_CHECKS=0 gives the old
walk; the switch is read once, before title code runs.

Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
set_targets gains a VICTORY_FAST_TARGETS fast path guarded by a view-generation counter bumped by create_rtv (off by default). VICTORY_SKIP_PIPELINES promoted to release (cfg(windows)); note_drop stays diagnostics-gated (off by default). Build: target-cpu=x86-64-v3 (AVX2) for Windows targets and fat LTO. docs/PERF-PASS.md handoff.

The play.ps1 ports-on-by-default change is intentionally excluded: it duplicates open PR #360. Note open PR #637 rewrites the same hot files (draw.rs/host.rs/shadow.rs/land.rs).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 16:32:53 +00:00
root_uav_slots/root_srv_slots were std HashMaps with the default SipHash hasher, keyed by (list, address) and looked up per root view per draw. Switch to the crate's AddressHash (already used for fresh_tables). Behaviour-identical, compile-verified on x86_64-pc-windows-gnu. Also records the micro-optimisation audit backlog in docs/PERF-PASS.md §8.
github-bot changed title from Frame-time pass: fast set_targets, skip-pipelines in release, AVX2/fat-LTO to Build: AVX2 codegen and fat LTO for the CPU-bound layer 2026-11-27 17:08:11 +00:00
github-bot force-pushed github-bot/gh-649 from b675791f35 to c16b9eb73c 2026-11-27 17:08:12 +00:00 Compare
github-bot force-pushed github-bot/gh-649 from c16b9eb73c to 83127786f5 2026-11-27 17:15:34 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-649'
git switch 'github-bot/gh-649'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-649'
git switch 'github-bot/gh-649'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-649'
git switch 'main'
git merge --squash 'github-bot/gh-649'
git switch 'main'
git merge --ff-only 'github-bot/gh-649'
git switch 'main'
git merge 'github-bot/gh-649'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.