gpu: reclaim empty Paged pages (ring-heap malloc growth) (#639) #644

Open
github-bot wants to merge 160 commits from github-bot/gh-640 into main AGit
Owner

@⁠jamal-fv on GitHub · 2026-11-28 21:05 UTC · original
jamal-fv:vibe/console-budget-footprint-639 → main · +58583 −5923 · 342 files · 160 commits · draft

Summary

  • Refs #643 (console-budget footprint).
  • Reclaim empty Paged pages (ring-heap MALLOC growth) — prior commit.
  • Anonymous VM / 87k regions: gapless multi-pool spans used Stitch (mach_vm_remap per 64 KiB piece → one untagged VM region each). Prefer wrap_title_memory when the title VA is already mapped (pieces=0); keep Stitch for unmapped VAs and gaps. VICTORY_TRACE_MEMORY buffer lines report stitch piece counts vs title wraps.
  • Report: reports/world-vm-growth.md.

Test plan

  • cargo test -p victory-gpu --lib mapped_gapless
  • cargo test -p victory-gpu --lib mirror_tests (47 passed)
  • cargo test -p victory-metal stitch_of_n_pages_makes_about_n_vm_regions
  • World footprint before/after — blocked: headless tip dies at 0xc000001d image+0x55ff714 (~75 s, frame 0), same RVA as pre-fix attempt; never reaches world / TRACE_MEMORY span lines.

How it was tested

  • Unit: mapped gapless title VA wraps (0 stitch pieces); fake VA still stitches; Stitch of N pages ≈ N VM regions.
  • Headless attempt: run-native.sh --headless --seconds 420 with VICTORY_METAL_TEXTURE_BUDGET_MB=4348 VICTORY_TEXTURE_DROP_TOP_MIP=1 VICTORY_TRACE_MEMORY=5 under game.lock — abort before world.
**@⁠jamal-fv** on GitHub · 2026-11-28 21:05 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/640) `jamal-fv:vibe/console-budget-footprint-639` → `main` · +58583 −5923 · 342 files · 160 commits · draft ## Summary - **Refs #643** (console-budget footprint). - Reclaim empty `Paged` pages (ring-heap MALLOC growth) — prior commit. - **Anonymous VM / 87k regions:** gapless multi-pool spans used `Stitch` (`mach_vm_remap` per 64 KiB piece → one untagged VM region each). Prefer `wrap_title_memory` when the title VA is already mapped (`pieces=0`); keep Stitch for unmapped VAs and gaps. `VICTORY_TRACE_MEMORY` buffer lines report stitch piece counts vs title wraps. - Report: `reports/world-vm-growth.md`. ## Test plan - [x] `cargo test -p victory-gpu --lib mapped_gapless` - [x] `cargo test -p victory-gpu --lib mirror_tests` (47 passed) - [x] `cargo test -p victory-metal stitch_of_n_pages_makes_about_n_vm_regions` - [ ] World `footprint` before/after — **blocked**: headless tip dies at `0xc000001d` image+0x55ff714 (~75 s, frame 0), same RVA as pre-fix attempt; never reaches world / `TRACE_MEMORY` span lines. ## How it was tested - Unit: mapped gapless title VA wraps (0 stitch pieces); fake VA still stitches; Stitch of N pages ≈ N VM regions. - Headless attempt: `run-native.sh --headless --seconds 420` with `VICTORY_METAL_TEXTURE_BUDGET_MB=4348` `VICTORY_TEXTURE_DROP_TOP_MIP=1` `VICTORY_TRACE_MEMORY=5` under `game.lock` — abort before world.
Legacy SSE integer forms reuse the VEX helpers in place. AES and PMULL use the ARM crypto
extensions. Diff tests against Rosetta for what it can run, known-answer tests (FIPS-197,
bitwise clmul, SDM definitions) for VAES/VPCLMULQDQ ymm, insertq/extrq and adcx/adox.
The title now lifts all but 6 functions (decode failures).
rt_host.c: dispatch over a hash built from the generated table, pluggable logged fallback for unresolved
targets, import thunks that marshal win64 arguments out of the Cpu into native calls, rt_call_guest for
host to lifted callbacks, per-thread TEB/stack, Zen 2 CPUID/XGETBV/RDTSC. gs: accesses read Cpu.gs_base.
Shared memory accesses are emitted as sld*/sst* so a build flag can order them.
victory-rt loads the lifted dylib into an arm64 process, maps the PE, binds its import table to Rust
functions and runs exports; tested end to end on a fixture with a real host.dll import table.
MP, SB, SB with mfence, LB and IRIW as lifted plain accesses against x86 under Rosetta.
-DRT_TSO makes shared (not rsp/gs based) loads acquire and stores release; -DRT_TSO_ALL orders
the stack too. Plain lifted code shows MP and SB reorderings; both TSO builds show none.
Input (apps/victory/src/input.rs, on the main thread beside the window's
event loop):
- Keys go to GameInput as Windows virtual keys and set-1 scan codes; key
  events are not passed on to AppKit (no beep) unless Command is held, so
  Command-Q still quits.
- A click in the window captures the mouse (pointer hidden and held): its
  motion turns the right stick, left button the right trigger (fire),
  right button the left trigger (aim), middle the right stick's click. F1
  or losing focus lets it go. VICTORY_MOUSE_SPEED (points a second for a
  full stick, 1500).
- Pads from Apple's Game Controller framework (DualSense, Xbox and others)
  are host pads 0-3: cross/circle/square/triangle as A/B/X/Y, Options as
  Menu, Create and the touchpad's click as View; player lights set.
- The keyboard and mouse also drive the first host pad, so both work at
  once; extra keys where a PC player looks: Space X, left Shift A, R B,
  G Y, left Control the left stick's click, V the right stick's click.
- Key presses are logged (to replay a run's path through the menus).

Window title, once a second: frame rate, frame time, GPU time a frame
(from command buffers' GPU start and end), draws a frame, draws dropped,
frame number. VICTORY_SHOTS=<dir>,<seconds>: the last frame at a quarter
size as PPM, for runs nobody watches.

Tried with Bahadır's keyboard: the start screen, FINISH SETUP and LEGAL
NOTICES pass with Enter and the arrows, into the loading screens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Input: our window input (keys with scan codes, mouse, Game Controller
pads) stays in the loop; upstream's key table is taken (Tab Menu, V View,
Space and Enter A, Esc and Backspace B) with our extras (left Shift A,
R B, G Y, left Control the left stick's click), and its live keys still
reach the pad through the same keys() (its window hook is left unused).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Memory the title reserves first and commits later was committed plainly,
where the GPU backend (which resolves title addresses by pool) cannot see
it. Now the parts no view shows and nothing committed yet get pools of
their own. Not reached yet in Grand Theft Auto VI's runs so far (n10 logs
no such commit); kept for the views that still say "not in a mapped pool".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
- victory-metal: a pass that cannot be encoded no longer drops its command
  buffer (the queue-order wait was already encoded and the next buffer waited
  for its signal for good: the title's fence never moved and its watchdog
  crashed it 30 s later, at the loading screen's end). An indexed draw
  without an index buffer is left out without leaving the encoder open.
- victory-metal: a render pass with no targets (pixel shaders writing only
  UAVs) gets its size from the draws' viewports (else scissors); Metal made
  no encoder for it.
- ExecuteIndirect of dispatches (types 2 and 105, count not in a buffer) runs
  on the native host: Metal reads the group counts from the argument record.
- A buffer view the host cannot make clears its heap entry: the stale entry
  let the GPU write where its previous view pointed.
- Translator: v_permlane16_b32 / v_permlanex16_b32 (inside one 32-lane half,
  so one host wave), v_cvt_pknorm_u16_f32 / v_cvt_pknorm_i16_f32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
- Image stores and typed buffer stores of some channels (dmask / format
  count) write the enabled channels from their VGPRs and 0 to the rest.
- FSPX compute programs take root constants: a block runs from its record's
  user SGPR to the next parameter's, or to the last user SGPR (RSRC2).
- s_pack_ll/lh/hh_b32_b16, s_absdiff_i32, v_ldexp_f32 (two exact powers of
  two), v_mad_u32_u16 (op_sel halves).
- Crash diagnostics: an access violation logs every register, the bytes at
  those that look like title addresses, and whether a pool holds them and
  which heap buffer views cover them (victory_core::crash, set by the app).
- Logs (first 200 each) of the title's big reservations (VirtualAlloc,
  XMemVirtualAlloc) and of commits that no pool backs, to place the
  addresses of "not in a mapped pool".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
- NativeHost::execute leaves out a command whose arguments cannot be made
  (a root parameter never set, memory no pool holds) instead of refusing
  the whole submission: other queues waited on memory that submission's
  other work writes, and on its fence signals (n14: three queues held for
  30 s, then the title's watchdog).
- Buffer views of memory no pool held when the title wrote them (the
  title writes views before mapping their pages; 750+ per run) are made
  again when the pool table changes.
- FSPX compute root constants of slot 255 (no root parameter) are refused
  again: nothing is known to fill them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Conflicts: our window input (crate::input: keys with scan codes, mouse,
GameController pads, the window figures) stays in the event loop; upstream's
modifier_key helper is kept for its key_event (kept for its test). In
gameinput, the stand-in pad keeps the mouse merged onto the keyboard one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
- Resource heaps reach HEAP_VIEWS entries (when the title's entries and
  the contract's fit) with null views at its last two, and carry a
  view-stride table (a dword per entry: element size, integer-format bits;
  0 for no buffer view), kept by `mirror` and bound as root SRV
  VIEW_STRIDES. Shaders taking buffer views at computed heap indices read
  it; without it their commands were left out ("root parameter 255 was
  never set", 40 a run) and the title's watchdog ended it 30 s later.
- Translator: the thread-group info SGPR (TG_SIZE: wave count, wave index
  over console waves), s_sext_i32_i8/i16.
- VICTORY_DUMP_THREADS=0 also dumps every thread at a write to address 0
  (the title's watchdog crashes that way).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
n17's thread dump at the title's watchdog: the main thread waited on the
render subsystem, which waited on its worker threads, all four inside host
calls: a scene's first frame binds ~1,100 new pipelines, translated and
converted one by one under the host's lock (~10 a second at the end), for
30 s, past the watchdog.

- Pipelines' shaders are translated when the title creates them, on a
  pool of threads (VICTORY_PREFETCH=0 off, =<n> threads), and compute ones
  converted to Metal libraries too.
- Metal Shader Converter conversions are kept by their input (a memo), so
  the pipeline made later finds its library; those made ahead up to 1 GiB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
On a 32-lane host (Options::wave32_host, the native Metal host) a wave64
compute program runs as two host waves per console wave, and what
reaches across the halves (ballots, lane reads, whole-wave reductions,
LDS shared without a barrier) meets at a group barrier. In a per-lane
branch or loop the two halves may not both arrive, so such a program
was refused.

Such programs, where the group is one console wave, are now made again
with the per-lane branches around the places where the halves are apart
taken by the whole wave, as the console's scalar unit takes them
(structure::structure_wide): the wave goes into an `if` where some
lane's EXEC bit is set, round a loop while some lane is, and EXEC stays
a guard on every vector instruction inside. Each such decision is the
console's: each host wave asks its lanes (WaveActiveAnyTrue, or AllTrue
for execz and vccz) and the halves exchange the answers through the
group-shared `xchg` array (lower/halves.rs, halves_decide), so both go
the same way and are together inside, where the existing exchanges and
LDS barriers then go, in loops too when every branch of the loop is
scalar or taken wave-wide (lower::together_blocks). The branches are
found from the blocks the lowering reports apart (lower::take_needs,
lower::branches_around: the mask branches those blocks depend on,
transitively; those to the program's end last) and added until no
block is apart (emit::widened).

A branch taken wave-wide is an Atom::Wave in the per-lane form, the
lane's own bit kept apart (Structured::lane_when), so that every
analysis that reads a branch as what a lane does sees the wave's
decision instead. EXEC joined at a loop header from a latch only scalar
code reads is now known along the back edge (Lanes::phi_args), which
such loops need once lanes outside EXEC go round. The halves form is
refused where a scalar branch they meet at tests a value the lanes may
hold differently (a join after a per-lane branch, or a first-lane read,
which is each half's own on this host: lower::scalar_parting), so that
no host wave waits at a barrier the other does not reach.

Programs that translated before are made byte for byte as before (the
walk runs only after a refusal). VICTORY_WAVE_WALK=0 on the native host
(Options::no_wave_walk) refuses them as before.

On the Wine route (D3DMetal, the same 32-lane limit), where our tree
runs wave64 programs as halves on a different lowering, the same walk
made 148 of the 153 wave64 programs bound in a recorded frame get a
Metal pipeline (115 before); the frame took 3.7 ms more GPU time with
the extra work drawn, and shadow blocks and missing culling were fixed.

Tests: emit/walk_tests.rs (six programs refused without the walk and
made in 32-lane waves with it; a program whose halves meet unchanged),
structure tests for the wave-wide branch and the loop header's EXEC,
and native/walk_tests.rs in victory-gpu, which runs the walked programs
on the GPU through Apple's converter against the console's results.

After f2f31d5 and 228be7c of our tree, re-applied by hand on the
wave32_host lowering.
Two reductions a branch chooses between that share their end (each arm
saves EXEC and reduces up to the read of lane 32, the join reads lane 0
and restores EXEC: cond ? WaveActiveMax(x) : WaveActiveMin(x)) leave no
block with a whole section, so the wave simulation does not follow them
and v_permlanex16_b32 is refused, or lowered on its own where the
console's section reads every lane. When a program does not translate,
or permutes lanes outside the sections the simulation follows, it is
translated once more with each such section in one block
(ir::whole_sections: the block that starts it takes the join's code and
exit, a copy where other ways lead there too; up to four rounds), and
that translation is taken if it succeeds. The SSA renaming is split out
of ir::build_bounded (ir::rename) so a changed program can be renamed.

On our Wine route, of the 19,106 containers of a frame capture,
a929109552ce1e84 (a compute program refused for v_permlanex16_b32) now
translates; the other refusals are lane-mask joins and lane masks read
as data, which this does not move. A test builds the two-arm program and
checks the sections are found whole after the join. Programs without
such a permute or refusal translate as before.

After darkworldhm/victory-fork-darkworldhm (ir::whole_sections).

(cherry picked from commit fdcc89332cf7af7c4f01a2beb2a57590ff83a000)
n19 died of a Metal "GPU Hang Error" at the scene's start (the other
buffers discarded as victims, their fence signals with them, then the
title's watchdog). Each submission's command buffer is labelled with its
command and draw counts and the compute shaders it runs, and a failed
buffer's report prints the label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
A small kernel copies each indirect dispatch's three group counts into a
slot of its own and zeroes them when they cannot be a dispatch the title
meant (a count past 65535 or more than 2^22 groups); the dispatch reads the
slot. Counts read from memory that dropped work never wrote are a likely
cause of the GPU hang at the scene's start (n19).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Upstream's v_permlane16/x16 lowering (fi and bound_ctrl followed) replaces
ours; our console-lane marking for v_permlane stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Surface::read_last read the presented texture with 4-byte rows whatever
its format. Once the scene presents a half-float (RGBA16Float) texture,
Metal wrote twice the buffer, over the host heap where the title's own
objects live: their pointers became half-float texels (+-inf, the cleared
HDR target), and the title crashed a second or two after the scene's
start ("AGX: Texture read/write assertion failed: bytes_per_row >=
used_bytes_per_row" just before; n12, n13, n20, likely n18). Only runs that
read frames (VICTORY_SHOTS) were hit. Rows are now the texel's size, and
wider texels are clamped to 8 bits for the caller; unknown formats none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Indices 0 and 1 are the converter's descriptor heaps: a dispatch after the
kernel that reads a heap the host does not bind would have found the
kernel's buffers there. VICTORY_INDIRECT_DISPATCH=0 drops indirect
dispatches as before, for comparisons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
This reverts commit 250a448739fcb5dd2b58e42dca146b924dc15c60, reversing
changes made to 027a7a6b02766736241a7c4baa9a559852e853a0.
This reverts commit 027a7a6b02766736241a7c4baa9a559852e853a0, reversing
changes made to b8242bf59654e9d6f623dc2f5d14bbd40ff76f8b.
This reverts commit b8242bf59654e9d6f623dc2f5d14bbd40ff76f8b, reversing
changes made to e05ff95bcec141c40c064bc76d9d3c5587cba5fe.
This reverts commit c0b54db942.
The n26 windowed run of d5a3ca0 logged 3,000 buffer-view rejections
across 64 KiB boundaries. It reached a draw counter of 6656 before
the 900-second run limit.

Follow adjacent title mappings when their backing offsets are
consecutive in the same physical pool. Reject gaps, repeated pages
and different pools. The regression test maps three pages separately
and verifies both the resulting span and the rejected cases.

The pool tests, x86-64 macOS release build and asset policy check
pass. The three failures in the wider host tests also reproduce on
d5a3ca0. The game run used the pre-fix build.
The windowed n27 run of 4c255d6 reached prologue prestreaming and
then exited on an access violation. All 16 GPU address descriptions
were unavailable. The locked-title regression test reproduces that
missing information for a mapped address.

Share the crash metadata independently of the title lock. Obtain pool
and mirrored buffer-view information without waiting, and include
whichever table is available in the existing crash report. Remove a
view's metadata when its slot is cleared, replaced with a texture or
its descriptor heap is released.

The five focused tests, x86-64 macOS release build and asset policy
check pass. The wider GPU suite has the two failures reproduced in
the pre-fix n26 comparison. The game was run once on 4c255d6.
n28 reached prologue prestreaming before the title watchdog fired.
Symbolizing its host calls identified reset_x on the render subsystem
and other threads in execute_x and compute_table. Pool information
was unavailable in all 16 crash address lookups.

Check a heap's cached page table generation before copying the mapping
list. Resolve each root view by its one pool address instead of copying
and scanning the entire map. On a remap, rebuild the table from a fresh
snapshot and keep using the same pool-offset contract.

The regression tests reproduce two unnecessary snapshots for two root
lookups and two snapshots across two identical dispatches. They now
verify zero snapshots for the root lookups and one for the two
dispatches, with a rebuild and correct writes after remapping.

Thirteen focused tests, the x86-64 macOS release build and asset policy
check pass. The wider GPU suite still has the two baseline failures.
The effect on the watchdog has not been measured in the game.
Conflicts: PoolTable::resolve keeps ours (bounds-checked, range walk) with upstream's comment and tests;
execute keeps upstream's cut/no-target/unset-root drops and still leaves out any other command that
fails to prepare (not the whole submission); the first-chance dump goes through report_at_fault and
also fires at the watchdog's write to address 0; typed buffer stores take upstream's form.
The unmapped-address test now expects the command to be left out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Our native host work (view strides, indirect dispatch, prefetch, translator ops, crash reports, pool
spans, input) and upstream main since 19a6b59, on the recompiled-title branch. Conflicts take the
newer code with the arm64 ABI: extern "efiapi" for every HLE function (the WASAPI and spatial audio
modules that came with main too), crate::title::call_win64 for calls into the title, and fn_addr! in
their method tables so the methods with floats by value (spatial SetPosition/SetVolume) are called
with their signature. The x86 thread dump, memory watch and write trap stay x86-only; the handle
traces' caller chain is empty on arm64. input and window build on both architectures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
The pool-offset page table of a heap was rebuilt whole whenever the pool table's generation moved:
a snapshot of every mapping under the pool lock (which the title's own map calls wait on, under
xmem's page-table lock), a new buffer, all under the title lock, for each command whose shader reads
memory, as soon as the streaming threads mapped a page in between. And only the last 8 tables were
kept: a superseded table was freed while queued GPU work still looked addresses up in it, so the GPU
could read and write title memory through stale or reused words (n24/n27/n28: frames at 0.8 fps in
the prologue prestream, DirectStorage waiting, the pool table locked at every crash read, f16 and
+-inf in pointer fields).

Now PoolTable keeps a journal of the ranges each change touched (bounded; a table further behind is
built again), and a heap's addr::Table is built whole once and then brought up to date in place:
only the 64 KiB pages that changed are rewritten, each entry in one 64-bit store, a new block before
level 1 points at it. A table that outgrows its buffer is copied into one twice the size and the old
one is kept. A page now shows a pool when all of it shows one run of the pool (mappings of 16 KiB
pieces in pool order included). A "page tables" line every 5 s says what was done; a pool with no
view pair left is warned about once.

The title lock records who holds it: holds and waits of 200 ms or more are logged with the caller.

Tests: the journal (changed pages, a released pool, a table too far behind), a kept table against
one built whole after unmaps, remaps, quarter pages and growth, and the GPU end to end following a
remap in place with no rebuild and no snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Function discovery walks from each start and takes an in-range forward jmp
as internal, stopping at `jmp reg`; so a thunk's target (a1: rva 0x9f6400)
and a switch case that tail-calls (a2: rva 0x5b4c9f0, the case reached
through a jump table in .rdata) were left out, and the lifted image aborted
there ("rt: no fallback installed").

`discover::sweep` decodes each final extent linearly and keeps its direct
call / jcc / jmp targets and executable `lea rip` targets;
`escaping_targets` returns those that land in no function (to feed back as
seeds) and those that land in the middle of one (reported only).
`victory-recomp escapes <pe> [seeds]` prints the first to stdout, the
second to stderr. On game_scarlett_master: 481 seeds, 61 targets into the
middle of .pdata functions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
- ds_bpermute_b32 in a wave of 64 permutes lanes 0..31 and 32..63 apart
  (RDNA 2 ISA 10.4.4): the lane read is the address modulo 32 in the
  reading lane's own half. It was lowered as a read across the whole
  console wave plus a 64-lane ballot, both exchange sites on a 32-lane
  host, so in divergent code it was refused ("cross-lane operation between
  host waves in divergent code", 34 programs in n28 with the others of
  that reason), and where the address wrapped past 31 it read the other
  half. It is now the host wave's own read and ballot. After
  VIctory-macOS 0665a0e8 (QB) and ka1qux f9a5034 (its test checked all 64
  lanes against RDNA 2 hardware). Tests: the permute lowers with no
  barrier and no exchange, also under an EXEC branch.
- An immediate sampler used with a comparison sample clears the reduction
  bits (0x180) before setting the comparison one (0x80): a minimum sampler
  (0x100) became a maximum one (0x180). After ka1qux 93b9b2f, port of
  Marvisak/VIctory #2983 (RVZO6).
- SDWA destination WORD_0 with dst_unused 1 (sext) copies bit 15 upward:
  a 16-bit -1 came out as 0x0000ffff. After fxceless 58de9bf (upstream
  VIctory #3124).
- BC7: the 2-bit rotation field exists in modes 4 and 5 only; in the other
  modes those bits are other fields, and reading them swapped a channel
  with alpha (wrong colours, a shift past the width in modes 0, 1, 3).
  After ka1qux 765d9fa (upstream VIctory pull request #3111). Test.

The shader translator changed: its cache keys move with the build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
a3 trapped 25 s in ("jump table index out of range", f_53bf950): the table
at rva 0x67694f4 has 8 cases, and the size came from `cmp r8d, 7` / `jae`,
after which the index is `add r8d, 2` and a branch target joins. The size
was taken from the last compare-and-ja within 40 instructions on any
register a move connected to the index, whatever happened in between.

Now `index_bound` reads forward to the table load with value numbers: a
plain copy (`mov eax, r13d`, `movzx r10d, dl`, `movsxd rax, ecx`,
`mov r8d, r8d`, `cdqe`) passes a value on, any other write (and a call, for
the registers the Windows x64 convention gives the callee) makes a new one,
a compare followed by ja/jae bounds the value it tests (the least of its
checks), and a branch target forgets everything before it. The load's
index is bounded by its value's check, or, for MSVC's two-level switch
(`movzx eax, byte [base+idx+bytes]`, then `mov ecx, [base+4*rax+table]`),
by the largest of the byte table's checked entries plus one. A table also
ends where the function's next table starts (tables sit side by side in
.rdata, MSVC's byte table right after its offsets); up to there an entry
in other code is a tail-call case, as with a check.

Over the exe's 3434 tables (`victory-recomp tablelist <pe> [seeds]`
prints them, to compare builds): 208 change. 167 unchecked tables no
longer run on into the next table's entries (21 -> 5 cases and the like);
10 MSVC switches go from 3-56 cases to their 2-47 real ones (the rest were
bytes of the byte table read as offsets, one as rva 0x10100); 28 checks of
another or a changed value no longer bound (2 of them had read one entry
of the next table; f_53bf950's two tables go from 7 to 8 cases); 3 tables
are newly bounded by the check of a copy made ahead of it (as at 0x22e39e3,
where the looser outer check would give 41 cases running into other
functions). Tests for each case.

Functions entered in the middle: a direct jump, call or executable
`lea rip` from one lifted function into the middle of another one (not its
own chained parts) went to the dispatcher, which has no function there.
Each such address that is an instruction of a function without landing
pads is now an entry of its own, `f_<rva>`: the same body after the
prologue, `goto` its label (`FuncIn::entries`, `inner_entries`); one that
is no instruction start gets a function that traps, so the table always
links. The exe has one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
a4 got past a3's trap, showed the intro (the first frame drawn by the
arm64 build), presented black frames from then on and read nothing more
from disk: title-main sat in 762 of 762 samples on one instruction of
f_9dcac0, `b .`. The guest code there (rva 0x9dd0d7):

    lock inc dword ptr [rax]          ; one more job handed out
  spin:
    mov eax, dword ptr [rsp + 0x48]   ; the counter the workers raise
    cmp eax, 8
    jne spin

The counter lives on the waiter's stack and the workers write it through
the address it handed them. Stack accesses are lifted as thread-local
(plain), so clang took the read as loop-invariant, the loop as endless,
and emitted a branch to itself.

`spin_reads`: in a polling loop (a backward branch over at most 16
instructions that only load, compare, test and branch: no call, no store,
no register arithmetic, so nothing of its own changes between turns) the
reads of fixed stack slots are emitted as shared accesses (acquire under
RT_TSO), which clang must repeat and which order what follows the exit.
In the exe: 50 such reads in 27 units. And `pause`, a spin-wait hint, is
lifted as ARM's `yield` with a memory clobber, so a waiting loop with it
reads memory again on every turn whatever it reads (182 units have one).
Tests: the spin above, a loop that writes its slot, one that calls, a
search loop that counts, `pause`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Upstream main since af380ca: #84 (s_pack_*_b32_b16, s_bfm_b64,
s_bitreplicate_b64_b32, v_mad_u32_u16), #86 and #93 (SCC of
s_lshl<n>_add_u32 and of s_add/s_sub/s_addk_i32), #92 (sample and gather
variants with offsets and comparisons), #83 (root signature blobs read
without a host d3d12.dll), #85 (FSPX root types refused by name), and the
UCRT fixes #70 #71 #72 #73 #96 #97 (vsprintf buffer rules, printf hex
precision, strtod hex scale and underflow, memmove_s, ilogb of a NaN).

Conflicts: ucrt/math.rs `ilogb` takes main's NaN case in the arm64
branch's `extern "efiapi"`. native.rs: this branch takes root constants in
compute shaders too (the block runs to the next parameter's first SGPR),
so main's new test of refused root types leaves type 0 out and keeps this
branch's check that root constants are a root parameter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
The arm64 run and main (#84) each added both; the run's arms came first,
so main's v_mad_u32_u16 (which refuses op_sel on the 32-bit addend and
integer modifiers, as its test expects) was never reached. Main's
v_mad_u32_u16 stays, and the run's s_pack lowering (the same as main's).
victory-shader: 235 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
a5 (the spin fix in) read on from disk past a4's stop and then aborted:
`rt: unresolved guest target 0x143de57f7 (inside an image, not a lifted
function start)`. f_3de2550 is a bytecode interpreter: `lea r12, [rip +
0x6553900]` once at its top, then `imul eax, edi, 0x3315` / `movzx ebx, ax`
/ `jmp qword ptr [r12 + 8*rbx]`, through 530 absolute addresses of its
handlers (relocated with the image). A jump through memory went to the
dispatcher, which has no function at a handler.

`find_jump_tables_ext` now takes `jmp qword ptr [base + 8*idx]` whose base
is an `lea base, [rip + table]` of the function (the last one before the
jump, else the first after it: the interpreter sets r12 once) as a table of
64-bit addresses (`Entry::Abs64`, beside `Rel32` and `Rva32`), sized as the
others without a check: up to the function's next table, else while the
entries land in the function. The lifter sends such a jump to one switch per
function after its body (`jt = <address>; goto JT;`, `jt` declared with the
prologue), whose default goes to the dispatcher as before; a function with
none keeps its old text byte for byte (so a relift rebuilds only the units
that changed). In the exe: three such jumps (the interpreter's two, and
0x5141259), 545 and 42 cases, every one in the function an instruction
start. Tests: the recovery, and the switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
a6 trapped ("jump table index out of range", f_1ffa540): the function's
switch is `movsxd rax, [r8 + 4*rax]` / `add rax, r8` / `jmp rax`, and one of
its cases is a virtual call in tail position, `mov rax, [rcx]` /
`mov rax, [rax + 0x78]` / `jmp rax`. The table finder took any `jmp reg`
with a scaled load and an add of the base into the jump's register within
40 instructions before it for a switch, so the virtual call got the
switch's five cases, and its real target trapped.

`feeds_jump`: the load writes the offset, an `add off, base` (the jump
takes off) or `add base, off` (the jump takes the base) follows, and on the
way from the load to the jump nothing else writes the offset and the base
(before the add) or the target (after it), no unconditional jump, indirect
jump, return or interrupt breaks the flow, and no branch target (the jump
included) joins another path. In the exe this takes the table from eight
jumps, all virtual calls in tail position behind a switch (0x11e405d,
0x11e4096, 0x11e40ae, 0x11e40d4 behind the one at 0x11e4047, 0x1ffa572,
0x4c497d, 0x2e800c9, 0x43833c1), which now go to the dispatcher; no real
switch loses its table. Test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
a7 aborted in bink2scarlett.dll: `rt: unresolved guest target ... rva
0x1751f`, a case of the switch at 0x1751d that the last change had taken
the table from. Bink (MSVC) loads the offset over its base register and
sets the base again in another one for the add:

    movzx ecx, byte ptr [rdx + rcx + 0x17a74]
    mov   edx, dword ptr [rdx + 4*rcx + 0x17a5c]   ; offset over the base
    lea   rcx, [rip - 0x1751a]                    ; __ImageBase again
    add   rdx, rcx
    jmp   rdx

`feeds_jump` now keeps the registers that hold the base: the load's base
register (unless the load overwrites it) and any one an `lea` of the same
address sets on the way; a write to one takes it out. The add must take one
of them. Over the 17 images, against the table recovery before
`feeds_jump`, only the eight virtual calls in tail position in the exe lose
their tables; Bink's switch is back (6 cases). Test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
a8 got through the loading screens and aborted at rva 0x51413db, a handler
of the interpreter at 0x5141100. It has two opcode tables, 0x6681790 (set
just before the dispatch) and 0x6681640 (set at 0x51415f8, which jumps to
the dispatch past the first `lea`), and one `jmp qword ptr [rdx + 8*rax]`.
The dispatch took only the `lea` before it.

Every rip-relative `lea` of the base register in the function now names a
table the jump may take; each is sized as before (the first ends where the
second starts), and `tables_for` gives the jump the cases of all of them.
A case can never misroute (the switch compares the address the jump read),
so a table of an unrelated `lea` costs only labels. In the exe the
dispatch at 0x5141259 goes from 42 to 84 cases, and 0x301360f gets one (16
cases) where it had none. Test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BotUDcRjHo3zJ1HWdpX4mk
Bring Metal residency, mesh/f16, pool/CB, and boot survival fixes onto the arm64 tip.

Co-authored-by: Cursor <[email protected]>
Bring in remote Metal off-frame compiles, shader skip-edge joins, and HLE fixes while keeping the arm64 prove branch tip current.

Co-authored-by: Cursor <[email protected]>
The branch's committed HEAD (93f40598, a merge of origin/main) does not
compile: it added `PassSubmission::label` but none of the 13 call sites
set it, and nothing reads it. The working tree had drifted back to the
pre-merge arm64 state (98 files, 64 of them byte-identical to HEAD^1) plus
34 local edits, and only built because one of those edits deletes the
dead `label` field.

Commit that working tree so the branch compiles again and workers have a
base to verify against. Content is unchanged: this is the tree every
prove from 285 to 303 built and ran. `pr-115-arm64-recompile` still
points at 93f40598, untouched.

Also in this tree, from this session:
- apps/victory: the on-disk shader cache was gated to Windows by a local
  cfg(windows); restored, so macOS stops re-translating every shader
  (measured 542 CPU-seconds a run).
- crates/victory-gpu/src/native/perf.rs: VICTORY_TRACE_PERF=<n>, a
  per-frame record/present/translate/GPU split.
- runs/one-prove.sh: it used rg (absent on the wrapper PATH) and parsed
  ANSI-coloured logs, so every score recorded frame=0.
Co-authored-by: Cursor <[email protected]>
MTLSharedEvent ignores signals at or below signaledValue; D3D12 allows rewinds and repeats, so start a fresh shared-event epoch when a fence value does not advance.

Co-authored-by: Cursor <[email protected]>
Record what differed from main, what was ported, verify output, and falsifiers.

Co-authored-by: Cursor <[email protected]>
Without these, DXGI depth-plane shader views fall through format() as None and mirror the raw depth texture instead of a float plane view (#439 cause 1).

Co-authored-by: Cursor <[email protected]>
Depth twins sync through a staging buffer; this tree's BlitOp was buffer-only after the arm64 prove snapshot. Adds CopyTextureToBuffer / CopyBufferToTexture and Metal encode with DepthFromDepthStencil.

Co-authored-by: Cursor <[email protected]>
Metal cannot shader-write depth textures. Port #258+#439 behaviour: colour twin at first depth-plane UAV (object or placed), full mip/array routes, immediate remirror of stale heap entries, and Depth/Twin/Both sync so render passes that sample see fresh depth.

Co-authored-by: Cursor <[email protected]>
Record which of the four causes this tree had, what was ported, verify output, and falsifiers.

Co-authored-by: Cursor <[email protected]>
World sample put BLAKE3 texture hashing at ~39% of samples because each
scanner round hashed every watched texture; resume at the next key.

Co-authored-by: Cursor <[email protected]>
Already present (2 ms / 32); world streaming needs the deadline stop after
the minimum so thousands of blank textures never stall a submission.

Co-authored-by: Cursor <[email protected]>
sync_keys hashed serially on the submitting thread; world dirty batches
pay BLAKE3 on one core. prepare() now shares the read across 6 threads.

Co-authored-by: Cursor <[email protected]>
Orchestrator needs batches/textures/MiB and lock vs off-lock times per
second to measure whether SCAN_BUDGET cut the ~39% BLAKE3 samples.

Co-authored-by: Cursor <[email protected]>
Documents what the arm64 tree lacked vs main, the four commits, and the
cargo test -p victory-gpu result including the known streams flake.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
All of the native macOS host work behind #380 as one commit on a6a58361:
mesh pipelines, described stream pipelines, buffer views over pool runs,
view address and stride tables, console-flow lowering, rectangle lists with
stage-in attributes, depth twins, residency sets reconciled at commit,
cheaper descriptor mirroring, attachment-less passes for target-less draws,
R9G9B9E5 aliasing, mesh output fitting, GPU copies into texture levels the
host left out (the texture is made again with every level), GPU lifetime
rules for retired heap objects, span buffers and title pools, and
diagnostics. See the pull request text for measurements.
Load TRACE peak ~1044 ms/s off-lock hash with ~96 unchanged/s: each upload was hashed again because seen lived only on the scanner thread.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
SetPipelineState, viewport, scissor, blend, stencil, index/vertex buffers,
root constants/views, buffer copy and value write only touch the list.
with_list_at runs those under the list lock alone so recording threads stop
queuing on the host mutex for work that never needs it.

Co-authored-by: Cursor <[email protected]>
create_placed_srv/create_srv used to realize a host texture for every view.
Most are never bound; leave them pending and realize from take_wanted at
sync. remirror_tables skips unchanged pending entries until the pool table
or resources_epoch moves, so failed mirrors are not retried every draw.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Repeated Create*View of the same descriptor under the title lock was
rebuilding the backend entry every time; leave it alone while the stamp
matches.

Co-authored-by: Cursor <[email protected]>
An unrelated registration bumped the global epoch and would force every
table entry through mirror again; revalidate stamps whose named key is
unchanged instead.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Take main's victory-gpu/metal/shader/backend host; keep the lift
(recomp/rt) and re-apply arm64 HLE adaptations (xmem exports, call_win64
host callbacks, may_map on macOS, LIVE_PAD fallback, method_sigs/hud).

Co-authored-by: Cursor <[email protected]>
Conflict resolutions favour union: covering+resolve_prefix, Binding heap+heap_access,
SKIP_PIPELINES+skip_builder, sized index buffers, resolve_or_alias+spans, attach_refund
on pr437real's dense/frame_time metal backend.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Main's MTLSharedEvent epoch path must drive submit waits/signals. Also align
mirror/Draw/Prep test callers with the merged Binding and alias tuple shapes.

Co-authored-by: Cursor <[email protected]>
Keep host/union host; retain arm64 lift adaptations (OWN_SCALE_FLOOR, aarch64
lift caveat, unconditional SEH dispatch, x86-only step_over).

Co-authored-by: Cursor <[email protected]>
Add mesh_fit/bvh_no_hit to the leftover gfx_refusal_tests Parts init (matches main), and record the two-merge union resolutions and acceptance proofs.

Co-authored-by: Cursor <[email protected]>
Port main's encoder-scoped heap residency onto the dense Heap, and
full mip×slice depth twins into twin.rs. Retarget wrap-walk asserts
to main's generation-tagged title_alias SIGNATURES counts.

Co-authored-by: Cursor <[email protected]>
Consecutive compatible records share one GATE kernel and one Metal-tracked buffer;
VICTORY_GATE_BATCH=0 restores one gate per record. Same clamps as before.
64 compute records: 64 gates off, 1 on; same for draws, mesh, and rectangle lists.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
World frames spend ~200 ms on whole-texture sync and remirror ~82k records because work scales with what is bound, not what changed (~532k entries checked).

Co-authored-by: Cursor <[email protected]>
Change-proportional remirror needs faulted page bases, not only store sites; ~532k entries are checked a frame today because dirtiness was invisible.

Co-authored-by: Cursor <[email protected]>
Offline model: 532k bound checks → ~40k on dirty pages; texture pools stay unarmed under Rosetta (issue #1).

Co-authored-by: Cursor <[email protected]>
bind_root no longer takes a named list; the cherry-pick left a Vec::new
that failed type inference at release build.
Document per-test residue verdicts and cherry-pick resolutions. Add
heap_access to gate-batch Dispatch constructors so victory-metal tests
compile against the #382 field.
Extends change-proportional.md: write watch is legal on arm64 for textures;
lifter store hook is a separate deliverable. Correctness, mapping, and
fail-toward-full-read fallback spelled out before code.

Co-authored-by: Cursor <[email protected]>
Key-level dirty oracle, textures_ok gate (flag + fault_tracking), arm()
range packing, and 16 KiB page measurements for the arm64 change signal.

Co-authored-by: Cursor <[email protected]>
On arm64 (fault_tracking) the submit watch covers texture ranges after
heaps; sync drops already-uploaded armed keys with no dirty page.

Co-authored-by: Cursor <[email protected]>
Point at reports/arm-change-signal.md; Rosetta still heaps-only.

Co-authored-by: Cursor <[email protected]>
Native macOS has no victory_gpu::watch; aarch64 is the stand-in for
faults that resume. Align design and docs with the compile-safe gate.

Co-authored-by: Cursor <[email protected]>
Inventory of per-frame host work, what is independent vs serial, and the
VICTORY_PARALLEL_HOST locking discipline that preserves second/third-pass
semantics. Offline model expectations included; no game run.

Co-authored-by: Cursor <[email protected]>
Flag-gated std-thread fan-out, heap remirror classify, and a modelled
frame that proves wall time falls as workers are added with identical
results. Default off.

Co-authored-by: Cursor <[email protected]>
Texture prepare worker sizing and probe reads fan out when the flag is
on; remirror classifies distinct heaps in parallel then mirrors
serially. Residency commit and encode stay serial. Document the switch.

Co-authored-by: Cursor <[email protected]>
Apple Silicon has no timestamp counter set, so the switch forces one
pass per command buffer and uses GPUStartTime/GPUEndTime to rank kinds
and top passes at present.

Co-authored-by: Cursor <[email protected]>
Top compute entries now name the pipeline hash, thread-group size, and group
counts so a warm pass trace can point at specific shaders instead of kind alone.

Co-authored-by: Cursor <[email protected]>
Run 348 could not name groups= for the fat 22-pipe compute CB because mixed
labels only printed hash×cmds; top-three pipes now carry shape counts.

Co-authored-by: Cursor <[email protected]>
Port the separable fat-CB attribution dump from 98c9f97a without the ICB
per-command bind change, so multi-pipe compute passes list every hash.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Break down NativeHost::execute under VICTORY_TRACE_FRAME_TIME without
changing behaviour yet: follow, group (pass build), resident, and
prep_reuse (count) sit beside prep/backend/enc_*.

Co-authored-by: Cursor <[email protected]>
When a kept draw/dispatch shares PSO, binding, roots, heaps and threads
with the previous kept command (VICTORY_PREP_REUSE, default on), skip
remirror and translated_args and replay Prep. Move RootArgs into
Dispatch/Draw instead of cloning. Wire follow/group/resident timers.

Co-authored-by: Cursor <[email protected]>
World-frame parts from runs 348/351, new counters, prep-reuse cut, and
the ms prediction a coordinator run should confirm.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Off by default; filter by pipeline hash. Logs sizes and u32 values only
(no addresses) so a warm run can show whether fat-CB trip counts are zero
while dropped_unset_root stays 0.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Shared sst* (and mask/atomic/string notes) call rt_note_store when
VICTORY_CHANGE_PROPORTIONAL arms the lift; open-once dirty via the host
callback. Offline litmus + ns/store bench included.

Co-authored-by: Cursor <[email protected]>
When the runtime bridge is registered, arm publishes ranges without
mprotect and feeds the same DIRTY table; Rosetta and sites keep write-watch.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
A first upload left dirty set (insert into empty seen), so the next prepare
re-hashed unchanged textures during load.

Co-authored-by: Cursor <[email protected]>
within used to wait on archive add under the lock the serialize held;
return the PSO after compile and let the archive thread add and write.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Scalar word-at-a-time mixing was ~5x slower than BLAKE3 in the host
bench; stripe with independent multiply-shift lanes so release stays
memory-bound. Cache keys keep BLAKE3.

Co-authored-by: Cursor <[email protected]>
Before/after MiB/s (debug + release), 110 MiB ms, and the effect on
the load hash share. Offline only.

Co-authored-by: Cursor <[email protected]>
Keep host heap entries across submissions; when the store-hook/write-watch
signal is armed and pool/resource/span deps still match, visit dirty pages
only and fail toward a full scan on overflow or a never-armed watch.

Co-authored-by: Cursor <[email protected]>
Document VICTORY_PERSISTENT_DESC (console-vs-mac L3): signal, correctness,
relift prerequisite, prep/remirror prediction, and offline index ceilings.

Co-authored-by: Cursor <[email protected]>
A ring heap rewrites far more descriptor indices than it keeps live. Clearing
a slot left its 256-entry page allocated (empty Option<T> slots), so MALLOC
grew with every index the ring ever touched. Paged::take now frees an empty
page; Entries::remove and the D3D12 host keep path use it. VICTORY_TRACE_MEMORY
buffer lines also report title-asked vs Metal HEAP_VIEWS heap sizes and live
dense entry pages. Refs #639.

Co-authored-by: Cursor <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:10:27 +00:00
Co-authored-by: Cursor <[email protected]>
Stitch left one anonymous VM region per 64 KiB pool piece; world streams
grew ~87k untagged regions. Prefer wrap_title_memory when the title VA is
already mapped; keep Stitch for unmapped VAs and gaps. TRACE_MEMORY reports
stitch piece counts; unit tests cover the wrap preference and region split.

Co-authored-by: Cursor <[email protected]>
Document the 0xc000001d at image+0x55ff714 that stops headless
remeasure before the world on this tip (same RVA as prior attempt).

Co-authored-by: Cursor <[email protected]>
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/644/head:github-bot/gh-640'
git switch 'github-bot/gh-640'

Merge

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