Commit Graph
169 Commits
Author SHA1 Message Date
给伊莉雅补魔 3af6d8fb0e GPU: add synthetic unit tests for query.rs and signature.rs
(cherry picked from commit 0be58e62d24181a9eb60244a7e4d878a3627d401)
2026-11-25 01:03:00 -06:00
TG0000 62d1b8139e GPU: seek directly to private data on final release
Co-Authored-By: GPT 6.2 Sol <[email protected]>
(cherry picked from commit 3e98bd7e0ce79762162ac958e3ab67cc85de00c9)
2026-11-25 01:03:00 -06:00
KoLolX3 77582c3af4 GPU: VICTORY_* switches set to 0 are off
Six diagnostic switches (VICTORY_D3D12_DEBUG, _GBV, _DRED, _WARP,
VICTORY_GPU_TIMING and VICTORY_DUMP_TARGETS) were on whenever their
variable existed, so VICTORY_D3D12_WARP=0 still selected the software
adapter. They now go through one helper that reads a value other than 0
as on and an unset variable or 0 as off; every other value keeps the
meaning it had. The README says so above its switch table.

(cherry picked from commit a4974e4c21c16e2305942e37a868647d42eefe37)
2026-11-25 01:02:59 -06:00
broccolize bda8238b80 GPU: clear DXGI outputs on out-of-range enumeration
(cherry picked from commit b796c8b8b80cfa4506f254474ab9fd7260bfd8e6)
2026-11-25 01:02:58 -06:00
Maraco91 89fb38b8cd GPU: every object answers for IUnknown
No graphics object's interface list holds IUnknown, so QueryInterface
for it (and every call that hands out an object by interface id) said
E_NOINTERFACE and returned null. COM code asks for it to compare two
pointers for identity, to keep an object as a plain reference, or to
pass it on to an API that takes any object.

object::is, which all of those go through, now also matches IUnknown.
The DXGI device answers with the D3D12 device, which it already stands
for: one pointer whichever of the object's interfaces is asked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 92f2c60c8159e34a47570aa81f3d25624cc6db5c)
2026-11-25 01:02:57 -06:00
Manuel Pérez 9e1014d498 GPU: hold SHADER_HEAPS across descriptor mirror and check query offsets
mirror() previously dropped the SHADER_HEAPS lock inside shader_slot() before using the returned &Heap, allowing a concurrent Heap::drop to free the heap while mirror() accessed it. Also guards copy_simple() against invalid descriptor kinds, rejects placed heaps whose address+size wraps u64, and checks offset+count*bytes in resolve_queries() against overflow (with a regression test).

(cherry picked from commit 628b95da5e738046d00995743e07137e48936ba6)
2026-11-25 01:02:56 -06:00
localandClaude Opus 5.5 925736dbd0 Merge fork main a26859f (the first room renders right)
Descriptor records the title copies as bytes are mirrored before each
submission. Views off their copy's elements: our rule (raw views too, and
now typed views on 16 bytes), the fork's copies. Wave sums of halves: ours
(the fork's test passes with it). Sizes of descriptors nothing uses: ours,
then the fork's for 2D images. The fork's count of cut indirect groups is
left out: up to WIDEST groups run as asked here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:00:56 -06:00
localandClaude Opus 5.5 955c8b49d9 A texture filled while the runtime remaps takes the pages that are there
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]>
2026-11-25 00:55:56 -06:00
fxcelessandClaude Fable 5.2 a26859fc5f The first room renders right: byte-copied descriptor records are mirrored, views off their copy's elements get their own bytes, card room for the first world frame, levels on demand run on the card
- Descriptor records the title copies into its heap as bytes are mirrored
  before each submission (pull request #305 by Flyander, after upstream
  VIctory 86a5ed6), with a per-slot fingerprint so only records that
  changed are mirrored, the page read through the kernel, a switch
  (VICTORY_HEAP_SYNC=0) and a counter: about 40,000 records a frame on the
  test machine.
- A buffer view off its copy's elements gets a copy of its own bytes
  (after upstream 86a5ed6; VICTORY_VIEW_OWN_COPY=0: refused as before).
- Room on the card for the world's first-frame bursts: buffer copies
  (VICTORY_CARD_ROOM_FOR_BUFFERS, now on) and render targets
  (VICTORY_CARD_ROOM_FOR_TARGETS_MB, 3,072); a copy turned down gives its
  room up and is logged; the texture pass asks again every 32 MiB. 98
  buffer copies made (945 MB) where earlier runs made 1; 25 MB compared
  on the processor a frame where it was 550 to 710.
- Levels on demand: the fixes of pull request #747 by AscilCH. First run
  on a card (RTX 4070, VICTORY_LEVELS_ON_DEMAND=1): no device loss, 3.1 GB
  not allocated for levels the title does not hold. Still off by default.
- The guarded blocks under storage writes into physical pages are opened
  by default (VICTORY_PAGE_WRITES=0: counted only).
- Shaders: a program is translated with first-half interpolation pairs
  only if it was refused for one (with it on for every program 8,551
  working pixel programs came out changed); parked lane-mask pairs,
  f64 conversions and sums, lane permutations: 14 more programs translate.
- Counted, not fixed: an indirect compute pass asks for about 77,500
  groups in x and is cut to 65,535.

One five-minute game run of these changes on the test machine: no device
loss, no failed request. This merged tree was built; its test suites
were not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 01:46:49 -05:00
localandClaude Opus 5.5 ab71750898 Merge local/world: fork main 8dd30ab (every view of a page is guarded)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:39:06 -06:00
localandClaude Opus 5.5 49c44f61d3 Merge fork main 8dd30ab: writes through one view of a page are seen at its other views
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]>
2026-11-25 00:38:57 -06:00
localandClaude Opus 5.5 6ae06963b2 VICTORY_SEND_CHANGED off by default: run tile1-0 lost light and geometry with it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:31:25 -06:00
local 240ea7a2bf Buffer views that begin between elements read their own bytes
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)
2026-11-25 00:17:46 -06:00
localandClaude Opus 5.5 31e2f75a5a Merge Each submission's shaders read the bytes it was prepared with (VICTORY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:17:28 -06:00
local bf9ebebf60 Merge local/next 2026-11-25 00:01:05 -06:00
localandClaude Opus 5.5 ba509c5a70 Addresses of ray-tracing structures: views of a structure have no buffer
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]>
2026-11-25 00:00:08 -06:00
localandClaude Opus 5.5 0b5f191b86 A pipeline sync waits for shader writes on the host
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]>
2026-11-25 00:00:07 -06:00
localandClaude Opus 5.5 0fdcaa3b1a victory replay --flow, --images, --until; shader-info names the hashes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:00:07 -06:00
localandClaude Opus 5.5 18c0129211 Each submission's shaders read the bytes it was prepared with (VICTORY_SEND_OWN)
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]>
2026-11-24 23:59:54 -06:00
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
local 4f6bd62362 Merge commit 'c651346' into local/upcopies 2026-11-24 23:51:11 -06:00
local 5b422ba020 wip: submissions send their own bytes 2026-11-24 23:51:11 -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
fxcelessandClaude Fable 5.2 8dd30ab472 A write through one view of a page is seen at its other views; page writes counted; levels on demand (off); warm-up; card memory numbers
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]>
2026-11-25 00:44:25 -05: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
local 50983d8042 Merge branch 'local/next' into local/copies 2026-11-24 23:24:47 -06:00
local cb72fc0a17 Merge commit '74045e4' into local/upcopies 2026-11-24 23:22:55 -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 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 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 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