Commit Graph
493 Commits
Author SHA1 Message Date
local 6553e304b3 Merge commit 'f61ecf3b' into night/light
# Conflicts:
#	crates/victory-gpu/src/shadow.rs
2026-11-25 05:50:06 -06:00
localandClaude Opus 5.5 ca714f12af docs: ray tracing, the state after the first runs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 05:48:49 -06:00
localandClaude Opus 5.5 34e2365e95 Title memory by address: the dump names what was built and unpacked; a small buffer's results once a list
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 05:48:04 -06:00
local 3f16581e03 Merge branch 'night/card' into local/next 2026-11-25 05:38:11 -06:00
localandClaude Opus 5.5 b7838005c0 Batched clamp: an unfilled mesh record is all zeros, as the clamp of one leaves it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 05:38:11 -06:00
localandClaude Opus 5.5 a3d5a8f532 Title memory by address: packed structures that are gone give their pages back; ranges only for views written
4 MiB for every constant that looked like an address took a third of the pages (run light-5). Which pages came for what is in the ten-second line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 05:29:50 -06:00
local 708c13484c Merge branch 'night/crash' into local/next 2026-11-25 05:00:34 -06:00
localandClaude Opus 5.5 8ec2df703c Draw records of 2^23 vertices or more and unfilled mesh records run empty
After victory-fork f85101b6, whose window checker found 90 records of 2^24 vertices in one list; ours
also run mesh records over 65,535 groups (all ones) empty instead of as 65,535 groups.

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

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 05:00:17 -06:00
localandClaude Opus 5.5 fbe8ecc617 Stores by address are bounded: title buffers take the builder's only where it was given them to write
A directory entry says whether stores by address reach its page (translator and host). Faults take at most 128 pages a frame and 8,192 in all; every slot of the copies' run holds a null view until its copy is there; a page is looked at once a frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:53:33 -06:00
localandClaude Opus 5.5 3b3aabc896 Merge branch 'local/next' into night/card
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:47:24 -06:00
localandClaude Opus 5.5 a008b7ee8d Card memory the CPU maps: scratch switch gone, what the others measured; a test
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:47:23 -06:00
local 57a8ff2214 Merge branch 'night/stream' into local/next 2026-11-25 04:44:19 -06:00
local 5b2af05e9a Merge branch 'local/next' into night/light
# Conflicts:
#	crates/victory-shader/src/emit/mod.rs
2026-11-25 04:43:44 -06:00
localandClaude Opus 5.5 4c53da0a52 Pages are mapped side by side: eight threads stand in the host's queue instead of one
Mapping and unmapping a view wait for what every protection change of a
view takes too (about 100,000 a second, the guards'): 0.2-4 ms a page, all
on the one thread the title loads with. Scatter maps and the GPU's
page-mapping copies go in groups of up to 64 pages, noted before and after
on the caller's thread, the system calls on up to eight
(VICTORY_MAP_THREADS=1: one after the other, as before).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:31:31 -06:00
localandClaude Opus 5.5 0aa2ab952b The title's idle and lowest threads run below normal: loading no longer waits for idle processors
VICTORY_TITLE_PRIORITIES=0: as the title sets them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:31:31 -06:00
local 150557a525 Merge branch 'night/crash' into local/next 2026-11-25 04:27:45 -06:00
localandClaude Opus 5.5 3d6cbbd527 Views are made beside the heaps the card sees and copied in whole
Measured on the RX 7900 XTX (indirect::tests::descriptors_written_under_readers):
a thread that makes texture views in a slot of a shader-visible heap lets the
card see a descriptor that is neither the old one nor the new one in 4 % of its
reads (35 of 822 million: the driver clears it and fills it step by step).
Copied from a CPU-only heap: none in 8,582 million reads, and three times as
fast (51 ns against 149). Title threads and our passes rewrite slots while
submissions run whose shaders pick them; three device losses of 2026-11-25
(play-1125-0203, n02, n03) were reads of memory no view names.

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

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

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:27:38 -06:00
local 12f082b27e Merge branch 'night/textures' into local/next 2026-11-25 04:21:13 -06:00
localandClaude Opus 5.5 a220a7bbb8 Title memory by address: packed structures go up whole when the builder unpacks them; small buffers' pages stay title memory
The arenas of run light-3, read offline: 2,833 instances, valid top levels and dynamic structures, three quarters of the streamed ones unpacked right. The rest were unpacked a second time (the same bytes streamed in again do not differ from those last taken), into garbage over their neighbours. And the sizes the title reads of a structure (compaction) never came back where their small buffer lay in an arena's page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:15:29 -06:00
localandClaude Opus 5.5 4b826da377 The first copy into a texture the title fills goes over what title memory holds
What the copy does not write was whatever the block of the pool held: the atlas of baked decorations (a 2048x2048 BC3 texture of
which a bake writes 256x256 at most) drew other textures' bytes over the waitress's face. VICTORY_COPY_OVER_TITLE=0: as before.
With a measurement of what a cold texture costs.

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

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:00:22 -06:00
local 611315291c Merge branch 'night/crash' into local/next 2026-11-25 03:56:18 -06:00
localandClaude Opus 5.5 3057c92ec8 Bakes take what is due now first; textures that change unnoticed are looked at each frame; placed textures over unlike targets said
VICTORY_RECHECK_SOON=0: after four frames, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:35:14 -06:00
localandClaude Opus 5.5 26b15e8fe3 Card memory the CPU maps: windows, sends and scratch (VICTORY_WINDOWS_BAR_MB, VICTORY_SEND_BAR, VICTORY_SCRATCH_BAR); the card's own stamps (VICTORY_CARD_SPANS)
GPU_UPLOAD heaps, all off by default. Replayed yard frame (capture
play-1125-0127): 36.3 ms; windows in the card's memory 31.9, sends 32.7.
Replay: --pace, --breadcrumbs, copies counted by the memory they cross.
VICTORY_GPU_LOAD_MS: what the title's GPU timestamps show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:35:03 -06:00
localandClaude Opus 5.5 98e6438d2b Merge night/textures: first level viewed, equal uploads left out, exact bakes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:24:09 -06:00
localandClaude Opus 5.5 6b643cf775 Merge night/cpu: a sampling profiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:23:59 -06:00
localandClaude Opus 5.5 bd267d85c9 Merge night/stream
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:23:50 -06:00
localandClaude Opus 5.5 62c13818e7 Fewer empty staging blocks kept; the raw twins made are counted
Run crash-1 held 5.2 GB of staging blocks (n02: 0.9): at most 8 empty ones
stay (512 MB of the PC's memory). With the frame line: raw twins made per
frame, and those that had to be views as the title's are.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:11:24 -06:00
localandClaude Opus 5.5 5b3e97f713 The process runs above normal priority, pipeline workers below the title's loading
VICTORY_PROCESS_PRIORITY=normal and VICTORY_PIPELINE_LOWEST=0 for the old
ways.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:06:38 -06:00
localandClaude Opus 5.5 baf947a380 Diagnostics: a sampling profiler (VICTORY_PROFILE=<from>,<to>,<ms>,<file>[;...])
Samples the 28 busiest threads, whole stacks, with what the frame is at.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 02:56:28 -06:00
localandClaude Opus 5.5 320c93a30c Formats: a texture of which only the smaller mips are there detiles from its start
After victory-amd bddfb4a5 (myokex).

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

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

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 02:38:31 -06:00
localandClaude Opus 5.5 c3830a5d36 Crash report names the indirect executions a list stopped at; constant buffer slots hold their scratch memory
Both device losses of 2026-11-25 (play-1125-0203, n02) stopped at the same
place, found by the run of three indirect executions between barriers in the
captures: compute 0452fc2d2e2fc4c3 (meshlet culling), behind fc5e66f8f873d3bb.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 02:34:49 -06:00
localandClaude Opus 5.5 0abcb9fd89 Shared locks for buffer and window lookups; early pipeline list without a small cap; crash report names what a list binds
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:59:21 -06:00
localandClaude Opus 5.5 b9672fd5a5 Speed and room: draws' own records left to the draws in the heap sync, 2^20 table slots, textures kept while the card has room
- VICTORY_HEAP_SYNC=all mirrors every copied record at once, as before.
- VICTORY_DYNAMIC_SLOTS sets the table slots past the title's.
- Room kept for card copies of buffers is 1 GiB at most (was 5 GiB on 24 GB).
- VICTORY_TEXTURE_KEEP=0 lets idle textures go after 5 s, as before.
- VICTORY_TEXTURE_AWAY_MS: a texture whose memory went is shown 3 s longer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:52:09 -06:00
localandClaude Opus 5.5 8177c4fab1 Pixel programs read their quad's neighbours with quad operations: helper lanes take no part in wave reads
The lamps' shadow maps write depth plus a slope bias, and the main pass takes
the normal's derivatives, from the quad's other lanes; a wave read of a helper
lane is undefined (0 on AMD): holes in shadows, dashed triangle edges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:52:09 -06:00
localandClaude Opus 5.5 85b6fb5803 Crash tracing that can stay on: VICTORY_D3D12_DRED=light and =faults; lost texture writes named
A removed device is reported by whoever finds it first, and the list it
stopped in by its name. The window stand-in of VIctory 9145d9d is left out
until it has been tried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:15:58 -06:00
local 5fae8ea1d8 Revert "HLE: show title windows through a stand-in that always reads its messages"
This reverts commit 9820bdc45e.
2026-11-25 01:14:23 -06:00
localandClaude Opus 5.5 70502d8db5 Merge local/upcopies
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:12:28 -06:00
localandClaude Opus 5.5 9634df7413 Merge local/lighting
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:12:28 -06:00
localandClaude Opus 5.5 38410b88ab VIctory e29391f, 13185f5 and 4fc9d70, by hand
16-bit interpolations write the half op_sel picks, with omod and clamp; the
device says whether it was removed; detiling ends with its staging buffer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:12:28 -06:00
AnoHunted adb608af1f Audio: an XMA write block past the ring's end wraps before the first write
The write block (context word 0, bits 27-31) was used as it is for the first
block of a pass, so one at or past the ring size (bits 22-26) was written
past the ring's end, possibly into another APU allocation, before it wrapped
with (write + 1) % size. Take it modulo the ring first, as the read block is
taken, and as advance_read does.

(cherry picked from commit 7a5d85e6a2867081ed54515ce7f33bae3fcb643d)
2026-11-25 01:08:05 -06:00
quaternion 01708dd7ba fix(hle): keep apostrophes intact when splitting relaunch args
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).

(cherry picked from commit eb8067f2eae84cb64081af357cd03a48944a42b2)
2026-11-25 01:08:05 -06:00
localandClaude Opus 5.5 329df7aef4 VIctory's 88 commits fitted in; clzero loops end as the console's do
The fork's emulation of a clzero loop zeroed from the start to the end and
left rax at the end: the instruction zeroes whole lines and the test comes
after it (VIctory's own test of it failed here). The title's descriptor
heaps are held shared while their slots are written (VIctory 628b95d held
them alone, for every thread that writes descriptors).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:06:46 -06:00