Commit Graph
332 Commits
Author SHA1 Message Date
local 84eae352a2 Indirect dispatches of more than 65,535 groups run whole (VICTORY_INDIRECT_WIDE)
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)
2026-11-24 23:55:23 -06:00
localandClaude Opus 5.5 8ece2ffe7c Merge local/shaders2: the dynamic descriptor search
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:54:17 -06:00
localandClaude Opus 5.5 1a93f0fdd1 Dynamic descriptor slots: the search goes past the cursor as far as it should
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]>
2026-11-24 23:52:47 -06:00
localandClaude Opus 5.5 af2baf5338 Merge victory replay --pixel: which commands change a pixel, in every target
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:51:04 -06:00
localandClaude Opus 5.5 958c34b03a Merge How much of a texture is mapped is read from the runtime's own record
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:51:02 -06:00
localandClaude Opus 5.5 8ad8002d10 Merge A refresh of a copy on the card sends the dwords title memory changed,
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:51:01 -06:00
localandClaude Opus 5.5 9713df6ecc Merge Merge local/next (e6f492d) into local/tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:51:01 -06:00
localandClaude Opus 5.5 c05f949c4b victory replay --pixel: which commands change a pixel, in every target
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]>
2026-11-24 23:50:34 -06:00
localandClaude Opus 5.5 c651346a8c A refresh of a copy on the card sends the dwords title memory changed, and no others (VICTORY_SEND_CHANGED, on)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:48:35 -06:00
localandClaude Opus 5.5 cd37859b39 Merge local/next (e6f492d) into local/tests
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]>
2026-11-24 23:47:04 -06:00
localandClaude Opus 5.5 c27a8ec844 How much of a texture is mapped is read from the runtime's own record of its views
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]>
2026-11-24 23:46:35 -06:00
localandClaude Opus 5.5 3bc3455fcd Merge local/shaders2: upstream translator and state fixes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:44:32 -06:00
localandClaude Opus 5.5 fbc1830858 DirectStorage reads files on a handle per worker; its page lookups do not wait for the title's mapping calls
- 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]>
2026-11-24 23:40:43 -06:00
localandClaude Opus 5.5 e6f492d81e Merge local/copies: holes known by their bits, landed blocks taken
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:35:15 -06:00
localandClaude Opus 5.5 4e3e0654bf Typed buffer loads of 16-bit channels pack two per register; skipped devices say why (upstream c430b1d, 100de0e)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:25:32 -06:00
localandClaude Opus 5.5 75cfb234e5 Upstream graphics state fixes: rectangle attributes, sampler bounds, A8 copies, depth footprints
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]>
2026-11-24 23:25:15 -06:00
localandClaude Opus 5.5 011735ff80 Anisotropic samplers with point mips keep them where the card has them (upstream e45bacd, 23fc8a5, 7dfa86f)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:24:56 -06:00
localandClaude Opus 5.5 c5a2f8d6fd Upstream instruction fixes: 64-bit literals, exact normalized ends, flat offsets, rare forms
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]>
2026-11-24 23:24:50 -06:00
local 50983d8042 Merge branch 'local/next' into local/copies 2026-11-24 23:24:47 -06:00
localandClaude Opus 5.5 77b82c9c22 Mesh primitive exports: corner indices are nine bits, the edge flags dropped (upstream c0228d9)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:24:23 -06:00
localandClaude Opus 5.5 26a801e21a Immediate sampler slots are kept apart by comparison mode (upstream 2286e03)
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]>
2026-11-24 23:24:05 -06:00
localandClaude Opus 5.5 74045e4682 Holes of view memory known by their bits; landed blocks taken; askings of views left out
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]>
2026-11-24 23:12:04 -06:00
localandClaude Opus 5.5 795d55eb73 Merge local/upcopies: checks of what goes up to card copies, picked writes (both off)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:11:04 -06:00
localandClaude Opus 5.5 26d818c57f Kernel reads, remapped views, freed memory and lost writes of title memory
- 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]>
2026-11-24 23:10:44 -06:00
localandClaude Opus 5.5 b1da728148 Writes through views picked from the heap come back (VICTORY_PICKED_WRITES)
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]>
2026-11-24 23:09:03 -06:00
localandClaude Opus 5.5 fecaa14b06 Merge local/streaming: requests start at the title's submit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:54:06 -06:00
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