Commit Graph
406 Commits
Author SHA1 Message Date
localandClaude Opus 5.5 68e10e57d6 A DirectStorage queue starts its requests at the title's submit, not at half its capacity
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]>
2026-11-24 22:53:34 -06:00
localandClaude Opus 5.5 827ec2d5d0 Merge local/copies (wide textures, joined writes)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:52:24 -06:00
localandClaude Opus 5.5 535a3835b1 Merge local/next (a79e248) into local/copies; a test of the bits against remapping
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:44:12 -06:00
localandClaude Opus 5.5 338f42479e Merge local/next (a79e248) into local/tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:38:14 -06:00
localandClaude Opus 5.5 151816ce6d Title bytes under overlapping shader writes once; textures on several threads; cheaper walks of a submission's steps
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:37:55 -06:00
localandClaude Opus 5.5 a79e248353 Merge local/shaders
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:36:14 -06:00
localandClaude Opus 5.5 2000401125 Merge local/copies
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:36:14 -06:00
localandClaude Opus 5.5 d4254dc02c Merge local/next d4772b3
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]>
2026-11-24 22:36:00 -06:00
localandClaude Opus 5.5 875a63a49d Buffers loaded past the cache are coherent; record counts of buffers picked from the heap
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]>
2026-11-24 22:35:28 -06:00
localandClaude Opus 5.5 9c2168a643 Views guarded while they are mapped stay writable; tests take turns on WARP
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]>
2026-11-24 22:34:28 -06:00
localandClaude Opus 5.5 ee188c1df0 Merge e1702e2 (landing on threads, card steps 2) into local/copies
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]>
2026-11-24 22:32:14 -06:00
localandClaude Opus 5.5 d4772b3847 Merge local/gpucost
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:21:05 -06:00
localandClaude Opus 5.5 002d7fab5f Merge local/shaders
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:21:05 -06:00
local 23b019755c Merge local/tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/indirect.rs
2026-11-24 22:21:05 -06:00
localandClaude Opus 5.5 017fb0b383 What goes up to card copies: a check, and fetches caught in between put right
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]>
2026-11-24 22:17:50 -06:00
localandClaude Opus 5.5 e5841a0553 Shader forms: lives of a spill lane, one lane of what a whole-wave section leaves
Water transmission volumes and the rest of the upscaler translate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:17:48 -06:00
localandClaude Opus 5.5 c802da4b67 Merge local/next into local/copies
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:16:46 -06:00
localandClaude Opus 5.5 e1702e2204 Merge local/waits (second version)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:16:01 -06:00
localandClaude Opus 5.5 007fe55730 Steps done on the card take along what depends on them (VICTORY_CARD_STEPS)
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]>
2026-11-24 22:15:31 -06:00
localandClaude Opus 5.5 0d5e4c8cbf What shaders wrote is landed on a few threads, beside the guards (VICTORY_LAND)
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]>
2026-11-24 22:14:03 -06:00
localandClaude Opus 5.5 037596241a Argument clamps in batches (VICTORY_INDIRECT_BATCH)
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]>
2026-11-24 22:10:47 -06:00
localandClaude Opus 5.5 160d22222c Views guarded while they are mapped stay writable; tests take turns on WARP
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]>
2026-11-24 22:09:38 -06:00
localandClaude Opus 5.5 2aa8134b59 Lighter refreshes of host copies; landing past the guards; the heap pass spread
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]>
2026-11-24 22:03:45 -06:00
localandClaude Opus 5.5 389db9efb2 Shader forms: sizes of views nothing reads, ordered sections, wave sums off the beaten path, counters
- 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]>
2026-11-24 22:02:52 -06:00
localandClaude Opus 5.5 65b4c43ec1 Merge local/waits
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 21:41:29 -06:00
localandClaude Opus 5.5 d626ecc659 Merge local/replay
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 21:41:29 -06:00
local e5f735d6ae Merge fork main 310c6eb
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/indirect.rs
2026-11-24 21:41:28 -06:00
localandClaude Opus 5.5 cc03ecbc82 Reads of title memory under flights done on the card (VICTORY_CARD_STEPS)
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]>
2026-11-24 21:39:04 -06:00
localandClaude Opus 5.5 f669746e67 The hash passes over copies in the card's memory walk a piece with 64 threads
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 21:37:54 -06:00
localandClaude Opus 5.5 475409218e Frame replay: the CPU's copies leave what the card wrote; buffers in the card's memory fit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 21:37:32 -06:00
localandClaude Opus 5.5 bdae3b372b Frame replay: where identical runs diverge; resources dying as a capture starts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 21:29:09 -06:00
fxcelessandClaude Fable 5.2 310c6eb6c1 Packed textures stay in the upload queue; a texture on the card is refreshed when the card is full
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]>
2026-11-24 22:19:10 -05:00
local c897fa28ff Merge local/replay: frame recorder and replayer
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	apps/victory/src/main.rs
2026-11-24 20:30:25 -06:00
localandClaude Opus 5.5 66afb2b4cb Only changed dwords go back into title memory; cheap safe copies; title's own arguments; more shader forms
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:28:42 -06:00
localandClaude Opus 5.5 af481877f3 Frame replay: usage doc, mesh draws and a title's size in its tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:23:46 -06:00
localandClaude Opus 5.5 d7ecfd2bba victory replay, larger tests of it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:09:57 -06:00
localandClaude Opus 5.5 1deaf0ebee Record and replay a frame's D3D12 work (diagnostics builds)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:00:23 -06:00
localandClaude Opus 5.5 7913a98a3d Merge fork main c96b4f2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 19:56:57 -06:00
fxcelessandClaude Fable 5.2 c96b4f2b83 The depth bounds test works (#82); faster defaults; textures are on the card before the character bake; one host copy per placed texture
- 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]>
2026-11-24 20:22:06 -05:00
localandClaude Opus 5.5 1ae8f260d8 Merge PR 220
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 18:57:48 -06:00
localandClaude Opus 5.5 fa967c0340 Merge fork main a803c87
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 18:57:47 -06:00
localandClaude Opus 5.5 9fea7434cd Streaming, copy queue, texture pools and a shader cache that survives rebuilds
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]>
2026-11-24 18:55:40 -06:00
fxcelessandClaude Fable 5.2 a803c87c48 Textures picked by index are looked at again after their upload (characters' skin and hair without colour in most launches)
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]>
2026-11-24 19:29:47 -05:00
fxcelessandClaude Fable 5.2 31714deb2d Take the fix/amd-view-heap-clamp branch of triippywhale's fork (as one commit)
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]>
2026-11-24 19:00:31 -05:00
fxcelessandClaude Fable 5.2 3bff182ef4 Take the test/fx-prs branch of asdaasdsaddf's fork (as one commit)
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]>
2026-11-24 19:00:31 -05:00
Vyacheslav VenglovskyandClaude Opus 5.5 7e239bfb0b GPU: the indirect clamp's groups past a count touch the budget not at all
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]>
2026-11-25 00:54:13 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 d5c15cb9dc GPU: the indirect budget lives in the card's memory
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]>
2026-11-25 00:35:20 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 32c6229990 GPU tests: the benchmark also runs with the budget in the card's memory
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]>
2026-11-25 00:12:47 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 23daba3650 GPU: the clamp walks only its group's records; benchmark against main's clamp
- 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]>
2026-11-25 00:06:29 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 3db5a0e87f GPU: the indirect clamp charges the budget once per thread group
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]>
2026-11-24 23:59:58 +01:00