With VICTORY_TEXTURE_NO_WAIT=1 a refresh that met the runtime remapping
title memory read the whole chain or nothing. A texture the title holds
only the smaller levels of is never all there, so nothing was read, and
the upload recorded before put the staging buffer's zeros over the
levels on the card. A staging buffer never filled now takes the pages
that are there; what was away for the moment of a change is read after
it, and a filling with less than was mapped makes the slots due again
(at most 8 times in a row). VICTORY_TEXTURE_FILL=0: as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fork's guard over every view of a physical page is kept on our own block
bits, known holes, kernel writes and changing blocks; what both had, ours.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A view D3D12 cannot place (a raw view off 16 bytes, a structured one off
16 and off its stride, a typed one off its element) was null, and the
shader read zeros: the colour-table bakes' parameter blocks are raw views
at byte 8. Such a view now gets a copy of its own bytes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b2a3ce9ced69e669d2d56e20c2dca7011b7e405a)
A shader that walks a structure takes its address out of the structure's
descriptor. The view has no resource, so the address came out 0 and every
ray missed. Also: only programs that store by raw address declare the
copies they reach that way as written.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console's syncs recorded nothing on the host, which orders nothing
between dispatches by itself. The ray-tracing structure builder has no
other wait between its stages.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On by default. Sends to card copies were copies out of their CPU sides made
when the card came to them, and later submissions had written those by then:
of three submissions that each copy a value to the same bytes and read them,
all read the last one's (test: 12 of 12 wrong). The bytes are taken into
memory of the submission's own at preparing; short runs go as one scatter per
copy. Title buffer copies go up whether our side changed or not.
VICTORY_CARD_ALL=1 (off): every title buffer's copy has two sides, so that
this holds for the small ones too (they are written in place now, under the
submissions in the air). VICTORY_PICKED_WRITES: 1 declares, 2 lands too.
The check (VICTORY_UPCOPY_CHECK): what a submission took twice is no longer
counted as older values sent; copies of the title's out of their place in a
submission; copies held for unchanged that are not title memory's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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)
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]>
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]>
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]>
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]>
Memory sync:
- The guard over every view of a physical page (code by myokex, victory-amd
c6dc4d8, after pull request #115 by Spexivus, its correction by joroyt and
a part of VIctory #1122 by tightfall): the title shows one page at several
addresses and a copy was guarded at one only. 0.8 to 1.0 million writes
through another view in a five-minute run on the test machine.
VICTORY_VIEW_GUARD=0 turns it off.
- Kernel reads into title memory are read beside and copied in (Joshua Odom,
10ea38e).
- Writes of the storage layer into physical pages are counted where the
title has the pages mapped and can open the guards there
(VICTORY_PAGE_WRITES, off: counted only). Failed page-destination reads
are retried.
Card memory:
- Levels on demand, off unless VICTORY_LEVELS_ON_DEMAND=1: a texture the
title fills takes card memory for the levels the title holds; held levels
get memory only while the card has room and are asked for again. Its test
runs on the software adapter; not run on a card yet.
- Refused texture slots are held back so a pass reaches the slots behind
them; room can be kept for card copies of title buffers (off).
Tools: translate --warm all; the shader cache is keyed on the translator's
source; counters for copy-back races, page writes and the copies the
texture sweep never lets go; a walls trace.
Game runs of these changes on an RTX 4070: five five-minute runs without a
device loss or a failed request. This merged tree was built; its test
suites were run on the tree the changes come from (gpu 129, hle 97).
Co-Authored-By: Claude Fable 5.2 <[email protected]>
- 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]>
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]>
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]>
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]>
- 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]>
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]>
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]>