Commit Graph
705 Commits
Author SHA1 Message Date
readmet3xt-labandClaude Opus 5.5 ff18de231c Merge agent/reflect: A stand-in for reflections without rays (VICTORY_AMBIENT_SPECULAR=<share>[,<sky>], off by default)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:26:46 +05:30
readmet3xt-labandClaude Opus 5.5 ac7a591601 Merge agent/haze2: Pixel programs keep the console's early depth test (VICTORY_EARLY_DEPTH=1, off by default)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:26:46 +05:30
readmet3xt-labandClaude Opus 5.5 2db59d4813 A stand-in for reflections without rays (VICTORY_AMBIENT_SPECULAR=<share>[,<sky>], off by default)
Without the structure builder every reflection ray the screen-space march leaves misses, and CS_RayMiss
(06bb6e728c7c99bf) writes the sky's light into the rays' texture (#38965, 853x480 R11G11B10, capture
C:\dev\captures\haze2): mean RGB (6.7, 10.9, 18.9) against (0.72, 0.44, 0.50) for the lit scene in the same
units, 100-1000x the room it should show and blue (the user's "reflections show a bright colour"; eyes glowing
blue-white, blue blotches on floors). Not a cleared or stale texture, and the cube maps are the sky's.

With the switch, right after each CS_RayMiss of opaque surfaces and of the alpha layer (not water: its first
root constant is 2), a pass of ours reflects the view direction about the normal made from the depth CS_RayMiss
itself reads (table (0,1000): #46202, a 1706x960 D32 target drawn in list 167 of the frame, before the trace)
and writes share x the light stand-in's directional estimate along it (ambient.rs, from
CS_CacheScreenSpaceRadiance), mixed with <sky> of the title's colour and never brighter than the estimate;
sky pixels (depth at the far plane) keep the title's value. CS_ResolveScreenSpace then writes its own hits
over it, so screen-space reflections stay. Expected cost under 0.15 ms a frame at 1706x960 (three dispatches).
A line every 10 s says it ran.

Written by a helper; built and tested at the merge into local/drive. A side finding to check: the diffuse
stand-in's depth slot (ambient::DEPTH, (0,464)) may name the stencil plane of #6481 after the
_ReflectiveCaustics variant 34fb51b8a0312e82.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:26:46 +05:30
readmet3xt-labandClaude Opus 5.5 41b4a056d6 Pixel programs keep the console's early depth test (VICTORY_EARLY_DEPTH=1, off by default)
A console pixel program whose DB_SHADER_CONTROL has DEPTH_BEFORE_SHADER
(bit 12, HLSL's [earlydepthstencil]) is translated with DXIL's
ForceEarlyDepthStencil flag when VICTORY_EARLY_DEPTH=1. The translator read
DB_SHADER_CONTROL but never used it, so every such program ran with the late
test on the host wherever it writes unordered views or discards, and its
writes to unordered views landed for pixels the depth test then rejected.

What that broke (capture C:\dev\captures\haze2, a character's head in front
of a window): the transparent pass (list 247; pixel programs
629743ca412296d4, 8ba01719b71d1d35, 5436c45060d74ebe and others,
DB_SHADER_CONTROL 0x1450) keeps the nearest transparent depth and its
velocity with 64-bit atomics in texture 46225 (R32G32, 1706x960); draw
271:34 (pixel 00ae3e9b98a0ae26, depth test ALWAYS, depth write on) writes
that depth into the scene depth 6481 and that velocity into the motion
vectors 38269 wherever it holds one. The glass, behind the head, wrote
there too: at the head's pixels in front of it the scene depth that the
heat-haze and in-scattering pass 731a39171b568298 (279:303) reads holds the
glass's (0.176, 0.85 m, for the head's 0.39, 0.38 m) and the motion vectors
hold the glass's velocity (-24, +31 where the head's own is +43, +35).
13.7% of that frame's transparent texels lie behind the opaque depth. The
haze pass picks heat haze (beyond 20 m) and in-scattering (beyond 137 m
there) by each pixel's distance, in 16x16 tiles: where the false depth is
far, it works on character outlines (expected cause of the blocks on hair,
not yet confirmed in a run).

The switch joins the shader cache's key only while it is on, so the default
translation and its cache entries stay as they were. Counted at the shader
cache's log line: programs given the early test, left late (switch off),
left late as they write depth or stencil. Tests: the decision, and a pixel
program translated with and without the switch (dxil.dll validates it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:25:28 +05:30
readmet3xt-labandClaude Opus 5.5 fa08ad6808 Merge agent/belo: frame rate switch ported from Belobug/VIctory-Belobug-AMD 49cb83b, 08b88b8 (VICTORY_FRAME_INTERVAL_MS, the title's own 30 fps setting patched to match; off by default)
Only run so far (y-fr60-a) ran from a cold shader-cache path: not yet measured fairly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:25:21 +05:30
readmet3xt-labandClaude Opus 5.5 2ff3e4a3a0 Merge agent/texqueue-ports: texture queue lock work (marks, batched tells, split lines; on), VICTORY_TABLED_REREAD and VICTORY_QUEUE_HOST_TEXTURES (off); ports of Belobug/VIctory-Belobug-AMD c278f0d, 4cd2d13+91018a5, 5d6bd84 (VICTORY_POOL_SMALL, VICTORY_SHOW_NEW_LATER, VICTORY_PRELUDE_UPLOADS; off)
Chain z1 (from the main path): A (new defaults) gameplay 33.9 ms p95 34.7, cutscene 38.8 ms p95 55; B (VICTORY_QUEUE_MARKS=0 VICTORY_QUEUE_BATCH=0, the old behaviour) gameplay 39.5 ms p95 54, cutscene 40.4 ms; C (TABLED_REREAD=1) 37.2 / 40.2 ms; D (QUEUE_HOST_TEXTURES=0) 36.4 / 41.8 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:25:20 +05:30
readmet3xt-labandClaude Opus 5.5 175d62fc6b Merge agent/dlss: DLSS Frame Generation on Series X with the colour without the interface, Streamline timing line (VICTORY_FRAMEGEN, off by default)
Runs from the main path (chain z1): z-fg-a/b with VICTORY_FRAMEGEN=1: gameplay 43.3 / 38.3 ms, cutscene median 47.8 / 41.1 ms, 0 s over 100 ms (z-base: 39.3 / 43.5 ms); first in-game run y-fg-a (cold shader cache) stalled for that reason only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:25:20 +05:30
readmet3xt-labandClaude Opus 5.5 91df493ead VICTORY_PRELUDE_UPLOADS=1: title textures uploaded on the list's prelude, decided at submission after the check (off)
Ported from Belobug/VIctory-Belobug-AMD 5d6bd84 ("Upload title textures in
submission prelude to fix frame-order & flickering"), where it is the only
way. A list records the upload of a title texture it samples only if the
staging buffer was changed when the list was recorded; the check at
submission may then find the memory changed and detile it, and only the
next list that samples the texture uploads that: a frame late when every
list of the frame was recorded before the check (a video's ring of buffers
shows an older picture, a texture streamed in its last one). A candidate of
the flicker at scene loads (analysis 6.12).

With the switch, `texture::upload_from` records nothing in the list: it
leaves a `PreludeUpload` (staging buffer, host copy, levels on demand) with
the list, and its `Step::Texture` as before, so the checks run where they
ran. At submission, after the list's steps, the staging buffers left pending
are refreshed (`Batch::refresh_textures`), and each texture whose host copy
was never uploaded or whose staging buffer was detiled since its last upload
is claimed (`claim_upload`; once per change, whichever lists of the
submission sample it) and copied on the list's prelude (`HostList::prelude`):
aliasing barrier for a pooled texture's first upload, to the copy
destination state and from there to the state the list starts with. What
the list's own upload did after the copy (a host copy grown, levels on
demand given memory, what the host copy holds) is done at the claim.

Kept as before: bakes (they record their copies whatever the check finds)
and movie planes. Left out of the port: the texture store's prefill (this
tree has none), the fork's refreshes before every copy and run step (here
`title_written` flushes the textures due already), the fork's change of
`Step::Texture`'s payload (the upload is held beside it instead, so the steps'
other readers, `card_steps` and `place`, are untouched), and its panel
change (unrelated).

Off by default (not behaviour-neutral: when textures are uploaded changes).
Tests (from the fork): a claim per change, in the same submission; a ring of
three buffers never shows an older picture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:08:54 +05:30
readmet3xt-labandClaude Opus 5.5 ee3fb5201a VICTORY_SHOW_NEW_LATER=1: slots show a texture made while earlier lists run only once those ran (off)
Ported from Belobug/VIctory-Belobug-AMD 4cd2d13 and 91018a5, where it is on
by default. Every device loss with the texture pool in that fork's report
(n08, n11, n15, steps-ab2, start-3, a user's play-1125-2107 without ray
tracing) was a page fault at the first byte of a texture in a block made
that millisecond, its title slot changed "at once" (`mirror`) while lists
sent before read that slot by index; VICTORY_SHOW_AFTER covers only some
paths (a draw's table, the texture pass's own uploads). We run the pool.

With the switch, `HostHeap::mirror` holds a slot whose new view shows a
pooled texture made while a submission begun before it may still run
(`pool::begun_before`: the submissions begun when it was made, noted in
`pool::made_now`) on what it showed, or the neutral texture if that cannot
stand for it (`keep_shown`), and flips it when every such submission has
finished (`FLIPS`, `texture_slots_flip`); a slot held back is held once, not
again at each draw or pass that reads it (`NEW_PENDING`, 91018a5). A line
says how many slots were held back since the start (with the switch on).
Also an A/B switch in diag builds (VICTORY_AB).

Off by default (not behaviour-neutral: a slot shows its new texture one or
more submissions later); with it off, `made_now` notes nothing more than
before and nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:08:54 +05:30
readmet3xt-labandClaude Opus 5.5 185bc4cc84 VICTORY_POOL_SMALL=0: pooled textures at 64 KiB multiples (off); diagnostics: a pooled texture read past its piece is said
Ported from Belobug/VIctory-Belobug-AMD c278f0d. That fork places pooled
textures of 64 KiB and less at 64 KiB multiples by default (4 KiB multiples
only with VICTORY_POOL_SMALL=1): its two device losses with the pool on the
night of 2026-11-25 faulted in 256x256 block-compressed textures with 7
levels placed at a 4 KiB multiple that is no 64 KiB one, whose descriptor
base lay 0xa000 into the piece and whose first level ended 0x2000 past it,
read by the card the moment the slot was made. Not proven to be the cause.

Here the switch keeps its name and meaning, with our default: unset or 1,
4 KiB multiples where the host allows it, as before; VICTORY_POOL_SMALL=0,
64 KiB multiples (at most 60 KiB more card memory per small texture). Also
an A/B switch in diag builds (VICTORY_AB). Diag builds with the address book
say loudly when a pooled texture's first level lies past the end of its
piece (`where_the_card_reads`, `book::address`), and where the first levels
of the first 40 lie.

The fork's test of a placed texture's reference to its heap is left out
(a measurement of the host; the fork weakened it in 4cd2d13).

Off by default: changes where pooled textures lie and how much card memory
they take.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:08:54 +05:30
local 45f6250378 Frame rate switch: the timers' shortest step follows the rate too (+0x2241fd0)
Run fps-1 (our clock at 16.667 ms, the title left at 30): the menus ran at
16.7 ms until the title's own limiter came up at 30 s (then 33.3 ms), and
meanwhile five of its seven timers stepped 33.3 ms a frame: game time ran
at twice the wall clock. The timer update (+0x2226040) takes the real time
since the last frame but at least 1/rate (+0x6849844), and that rate comes
from +0x2241fd0, a third read of the same setting. It now returns the rate
asked for (1000 for no limit), the original bytes checked first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 08b88b8266c2d0294d483d29b15534872ebc7da9)
2026-11-27 01:08:53 +05:30
localandClaude Opus 5.5 bacb402091 Frame rate switch: VICTORY_FRAME_INTERVAL_MS (our clock) and the title's own 30 fps setting patched to match (off by default)
The title asks for 33,333 us (SetFrameIntervalX) because its graphics
settings hold a frame rate of 30 (settings +0x210): +0x1e0fb30 and
+0x22434a0 turn it into a frame time (+0x98f84ac), +0x247ab10 picks the
interval from it and the display's 60/120 Hz (a 120 Hz mode alone changes
nothing at 30), and +0x120530 is a QueryPerformanceCounter limiter of its
own at the same rate.

VICTORY_FRAME_INTERVAL_MS=<ms> (16.667, 8.333, 0 = no wait): frame.rs ticks
at that interval whatever the title sets; the loader makes the two loads of
the setting "mov eax, rate; nop" (rate = 1000/ms rounded, 0 = the title's
own "no limit"), with the original bytes checked. VICTORY_TITLE_FPS=<n>|off
overrides the rate or leaves the title alone. Diagnostics:
VICTORY_TIMER_LOG=1 logs the title's timers once a second and frame pacing
bands every 5 s.

Ported from Belobug/VIctory-Belobug-AMD 49cb83b (author: local); the descriptor-site module of renderer port 2 left out. Our VICTORY_FRAME_INTERVAL_US (our clock alone) still works; VICTORY_FRAME_INTERVAL_MS is read first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:08:53 +05:30
readmet3xt-labandClaude Opus 5.5 13dca45ac6 Texture pass: a slot shown after its upload or flipped uses the view read at its turn's start
The pass reads the view a slot holds at the start of the slot's turn (under
the views table's read lock: the record, the view by its number, a copy of
it). For a slot shown after its upload (VICTORY_SHOW_AFTER=1, in the
launcher) or flipped from an earlier view of the same texture, it read the
same record and view again a few microseconds later to make the host
texture and its upload. It uses the first read now. Other threads waited
86-383 ms per 5 s of a cutscene for the views table's lock
(coolfox-20261126-233017).

Behaviour-neutral: the record may change between two reads, and using the
first is as if the second had come that much earlier; a write of the slot
meanwhile queues it again, as before. Slots made at once (the other path)
are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 5dda41ddff VICTORY_QUEUE_HOST_TEXTURES=0: records of textures the host writes are not queued for the texture pass (off)
A slot's record of a texture object the host renders to or writes (a
target, depth or unordered access texture) is queued for the pass over
textures picked by index like any texture. The pass takes such a slot,
finds nothing to bring up to date (it makes and uploads nothing for it) and
takes it out; the title writes such views into its tables' slots every
frame, so they come back, each time a take of the queue's lock, a place
among the slots due and a few microseconds of the pass (58,978 of 90,699
slots taken in 5 s of a cutscene found nothing to do,
coolfox-20261126-233017 18:02:23; 18ff932 says how many were such views).

With the switch, such a record takes the slot out of the queue as a buffer
view's does (`note_buffer`; with the queue's marks, without its lock when it
is not queued). Counted since the start in the lock line.

Off by default (not behaviour-neutral, though the pass did nothing for these
slots): fewer slots are due, so a pass reaches others sooner, the catch-up
budget (VICTORY_TEXTURE_CATCHUP, started by the count due; off in the
launcher) starts less often, and a bake's pass is asked for less often (it
runs when the queue's write count changed).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 8625c3a00b VICTORY_TABLED_REREAD=1: a table read takes out a slot written after its frame's first read (off)
A slot draws read through a table leaves the queue of textures picked by
index at its first table read of a frame only (`tabled_in`, once per slot
and frame; and the draws of a recording tell of a record once,
`Listed::tabled`). The title rewrites tables' slots while it records: a
slot written after that read is queued due `TABLED_GRACE` (8) frames on, the
draws that read it later in the same frame leave it there, and the pass
takes it 8 frames later and finds it uploaded by those draws or nothing to
do: 17,000-58,000 slots in 5 s of a cutscene (coolfox-20261126-223059,
analysis 6.6; "read through tables" and much of "nothing to bring up to
date" in the pass's split line).

With the switch, such a later read takes the slot out when the queue's marks
(b5b7806) say it holds it, a lock-free look (without the marks it does
nothing: every read would take the lock), and the recording's gate lets a
slot the queue holds through, so the draw also makes the title's slot in
place as at a first read (`mirror_after`). Counted in the lock line: slots
taken out by a table read after the first of their frame, since the start.

Off by default (not behaviour-neutral): a shader that picks such a slot by
index then sees what the draw made of it at once, not what the pass makes 8
frames later; that lateness is a candidate of the flicker at scene loads
(analysis 6.12).

Test: written after its frame's first read, a slot waits for its grace
frames; a later read takes it out with the switch only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 abf1020d25 Texture pass: tells the queue a batch at a time, takes what it knows of a slot with the slots due
The pass over textures picked by index took the queue's lock once or twice
for every slot it took: to ask what is known of the slot (a texture uploaded
whole, waiting for a look again) and to tell what came of it. In 5 s of a
cutscene it took 90,000-250,000 slots, and its "telling the queue" was
143-400 ms, about all of it waiting for the lock (152-355 ms by the pass;
coolfox-20261126-233017 18:02:18-18:02:23).

- What it found of a slot (done, uploaded in part, uploaded whole and looked
  at again, nothing to upload now, held for room) is told 16 slots at a time
  under one take of the lock (`HostHeap::texture_slots_told`), the rest when
  the pass ends, on every way out. A slot's entry is told of a few slots'
  work later, as it would be if the pass's thread were held up for that
  long; what is told of a write the queue no longer holds is dropped as
  before (`TextureQueue::same`).
- What the queue knows of a slot waiting for a look again is read while the
  slots due are taken, in the same take of the lock
  (`HostHeap::texture_slots_due_known`), and used if the queue's marks
  (b5b7806) say it still holds the write handed out; else it is asked as
  before.

Behaviour-neutral: the queue ends as it would with each slot told at its
turn (test), only some microseconds later. On by default;
`VICTORY_QUEUE_BATCH=0` tells and asks each slot at its turn, as before.
The lock line (18ff932) counts the lock taken by the pass apart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 2ad55e65b3 Texture queue: notes that change nothing leave its lock alone (marks of what it holds)
Every slot record a recording thread, the heaps' records thread or a draw
makes is noted in the queue of textures picked by index under its one lock
(`HostHeap::queue_texture`), and so is every first table read of a slot in a
frame (`tabled_in`) and every slot a newer view makes stale. Most of these
change nothing: a buffer view, a sampler or a null taken out of a queue that
does not hold the slot; a slot a draw or the pass made from the record the
queue holds already (`seen`, kept as it is); a table read of a slot not
queued. Other threads waited 33-44 s for the lock in a run of 150 s
(coolfox-20261126-232343, -233017), up to 3.3 s in 5 s of a cutscene.

The queue now marks, per title slot, the write of the entry it holds (0:
none; `QueueMarks`, set by the queue itself under its lock). These three
places read the mark first and do not take the lock when it says nothing
would change. Behaviour-neutral: a mark read while the queue changes it
says what the queue held just before or just after, as if the lock had been
taken a moment earlier or later, which any of these threads may always do;
writes (not `seen`) always take the lock. Counted as "not taken" by place
in the lock line (18ff932). On by default; `VICTORY_QUEUE_MARKS=0` takes the
lock every time, as before (for comparing).

Tests: the queue marks what it holds through writes, makes, looks, uploads
in part, memory made due and removals; notes that change nothing leave the
queue (and its marks) as they were.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 4cee21f397 Texture queue's lock by place, the pass's shown, nothing and before parts (5-second lines)
The split line of 7d8d56a found, per run of ~150 s, 3.8-5.2 s of the pass
and 33-44 s of other threads waiting for the lock of the queue of textures
picked by index, and 5.0-7.0 s in "slots shown after their upload, flipped
or made at once" (coolfox-20261126-232343, -233017). Two more 5-second lines
say where:
- the queue's lock by place (`descriptor::queue_site`: the pass asking of or
  telling of a slot, taking the slots due, making slots due, noting a slot's
  record, table reads, stale views, else): the times it was taken, the waits,
  how long the places that hold it for many slots held it (the slots due,
  slots made due, stale views), and the times it was not taken (none yet);
- the pass's parts: slots made at once, shown after their upload and
  flipped (time and count); the slots with nothing to bring up to date by
  why (views of textures the host writes, no texture, the host's own
  texture) and how many of them the pass made at once; the work before the
  loops (slots made due, views made again and flips, taking the slots due).

A lock taken is counted by one relaxed add under it; hold times are timed
only at the places that hold it for many slots. Nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 8a9353817e Frame generation: where a frame's time goes in Streamline's calls, on a line every second
With VICTORY_FRAMEGEN=1 and presents through Streamline's swap chain:
"DLSS Frame Generation, time per frame: the presenting thread N ms
before the present call, N ms in it (the longest N ms), N ms after it;
of those N ms in the latency markers and N ms asking frame generation's
state; an upscaling recorded in N ms (N ms of it waiting for the lock it
shares with the present); the copy of the colour without the interface
recorded in N ms". Counting and logging only; nothing is timed without
frame generation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:42 +05:30
readmet3xt-labandClaude Opus 5.5 2c5054fa79 docs: frame generation's colour without the interface on Series X, new switches, the checks of the first run in the title
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:42 +05:30
readmet3xt-labandClaude Opus 5.5 b8aadfae24 FidelityFX: said when the title's own upscaler is not made (frame generation without DLSS at 1440p)
VICTORY_FRAMEGEN=1 without VICTORY_DLSS=1 leaves the upscaling to the
title's FidelityFX, whose shipping FSR4 is made for 1920x1080 only; at
another output its context is not made and the title fails at its first
upscaling. The log now names the cause and the switch to add. Logging
only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:42 +05:30
readmet3xt-labandClaude Opus 5.5 1d0fa87f39 Frame generation on Series X: the colour without the interface, copied in front of the title's interface composite
On Series X the title blends its interface target over the frame itself:
one triangle (vertex 0602c2384acbb3b2, pixel a78d088fa55aa495), the last
draw into the texture it presents. With VICTORY_FRAMEGEN=1 the target is
copied into a texture of ours in front of that draw, at its place in the
title's list, and the present tags the copy as kBufferTypeHUDLessColor
(VICTORY_FRAMEGEN_HUDLESS=0: not). Log: the first copy, each other
pipeline that draws into a presented texture, and counts every ten
frame-rate lines.

Found reading the in-game path:
- Frame generation's constants get the camera's planes in order (the
  title names the far plane first; the projection took 10000 for the
  near plane of an endless range). DLSS Super Resolution's are as before.
- With Streamline's swap chain the system's Alt+Enter is not taken.
- Video memory is logged before the first present with frame generation
  on and 240 presents later.

upscaler-check: a stand-in colour without the interface is tagged with
--present; with a device the check ends with frame generation off, the
swap chain let go and slShutdown (VICTORY_CHECK_TEARDOWN=0: not): the
exit code is 0, where the process failed fast at its exit before
(0xC0000409, shown as 9). VICTORY_STREAMLINE_PRESENT=1 (off): with DLSS
and no frame generation our swap chain is Streamline's proxy of it, which
ends "presentCommon() was not observed" (the check runs it with
--present: 120 upscalings and presents).

With VICTORY_FRAMEGEN off and the new switches unset the title runs as
before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:42 +05:30
readmet3xt-labandClaude Opus 5.5 a83bc910a7 Merge agent/mapping: title views kept in the books alone until the title's CPU touches them (VICTORY_SOFT_VIEWS, off in the code)
Runs from the main path (warm shader cache), same build, 2026-11-27 00:40-01:02:
- VICTORY_SOFT_VIEWS=copies (m-copies, -b, -c): cutscene median 39.2 / 39.3 / 40.9 ms, p95 57 / 51 / 52 ms,
  0 seconds over 100 ms in each; gameplay 35.4 / 36.4 / 34.7 ms.
- switch off (m-base, -b, -c): cutscene median 66.6 / 63.3 / 66.0 ms, p95 181 / 102 / 167 ms, 20 / 4 / 11 seconds
  over 100 ms; gameplay 60.1 / 72.6 / 35.6 ms.
- streaming log (m-base vs m-copies, ~140 s): the title's page-mapping copies 35.1 s -> 2.0 s; unmaps 322,253
  (31.9 s) -> 155,387 (10.1 s); maps 419,724 (19.4 s) -> 219,805 (6.6 s); 242,583 views noted without a Windows
  view, 1 made real. No device removal, no faults; fixed frames as before.
- VICTORY_SOFT_VIEWS=pool does not help yet (157,364 of 199,786 made real, 150,484 of them asked by our GPU side).
The launcher sets VICTORY_SOFT_VIEWS=copies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:03:28 +05:30
readmet3xt-labandClaude Opus 5.5 fb838e8251 Title views kept in the books alone until the title's CPU touches them (VICTORY_SOFT_VIEWS, off by default)
VICTORY_SOFT_VIEWS=1 (pool: the title's XMemMapPhysicalPages views alone;
copies: those of CopyPageMappingsBatchX alone): a view is noted in the
runtime's books and told to the GPU side as mapped, its addresses are one
placeholder of their own, and the host maps nothing. Each view of the host's
was a MapViewOfFile3 (45 us) and later an UnmapViewOfFile2 (93 us), both
behind a lock of the kernel's that the guards' protection changes take too:
445,503 maps (20.1 s) and 349,175 unmaps (32.6 s) in 143 s of run stream2,
359,969 mapping calls 23.8 s, 3,294 page-mapping copies 33.7 s, one of them
467 ms of a 608 ms frame (timeline tl.120).

Who gets the bytes of such a view, and how:
- DirectStorage writes pages by number through the section's own view, and
  page-mapping copies read the pool from the books: as before.
- The GPU side's reads of title memory (host::read, read_sparse) take them
  from the pages through the section's view (xmem::soft_read); a texture
  with such views is read through a copy, not in place; texture::committed
  takes such views for committed.
- The guards keep such a view in their books (watch::protect_here,
  protect_alias): no VirtualProtect, no question to the host. A write the
  runtime tells of, or one through another view of the page, opens it as
  before.
- Any touch of the memory itself (the title's CPU, a direct read of ours)
  faults; the GPU side's handler has the runtime map the view and the access
  is made again; the guards then open it and every other view of its page
  (title_memory_made_real). Our writes through the kernel, announced kernel
  writes, and the title's XMemVirtualQuery, XMemVirtualAlloc, VirtualFree
  and (with the switch) VirtualQuery and VirtualProtect ask first.

Why VICTORY_LAZY_VIEWS=1 ran at 2 fps (run xw-lazy, 2.4 to 3.4 GB of copies
a frame): a view guarded together with a lazy view of the same page was
never clean, because the host refuses to protect a placeholder
(protect_alias), so it was copied again at every asking; and every guarded
range made its lazy views real. Both are what the books replace here. Also
for both switches: a view is known as lazy before the GPU side is told of
it (a refresh in between noted the block absent), and its pages are
committed when it is noted (the GPU side writes them through its own view
of the section).

Counted: the streaming log's M line gets twelve more fields with either
switch (noted, let go untouched, made real; noted by mapping calls, by
copies; made real by a fault of the title's code, of other code, asked for
by the GPU side, by a call of the title's; reads served from the pages,
their KiB; such views now), and with VICTORY_SOFT_VIEWS the log has a line
of the same every 10 s, with the last faulting address and code.

Tests: xmem and host views_in_the_books_alone_are_read_from_their_pages, watch
a_view_in_the_books_alone_is_guarded_there. Not run in the game yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 00:32:01 +05:30
readmet3xt-labandClaude Opus 5.5 4732b4676b Merge agent/texpass up to f668b99: texture pass split line, census fix, staged-texture questions only at title addresses
Runs y-texA-a/b (this branch) vs y-base-a/b, y-texB (VICTORY_STAGED_ASK_ALL=1 = old cost), 2026-11-26 23:20-23:47:
asking Windows whether a staged texture is all there cost 271 ms per whole run with the old behaviour, 91-189 ms
with these commits: a real but small saving, not the 400-700 ms per 5 s expected. The pass's "rest" did not drop
beyond run-to-run noise (whole-run sums 14.9-21.3 s vs 16.3-18.2 s). The new split line shows where it goes:
slots shown after their upload or flipped 5.0-7.0 s per run, telling the queue what came of each slot 4.0-5.6 s,
waiting for the queue's lock 3.8-5.2 s by the pass and 33-44 s by other threads. Gameplay frame unchanged
(33.8/34.0 vs 33.2/33.5 ms); fixed frames match. 4c58bf2 (VICTORY_TEXTURE_FRAME_MS) is left out: run y-texC no
better.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:52:23 +05:30
readmet3xt-labandClaude Opus 5.5 6b3960daf2 Staged textures at title addresses: whether all is there, from the runtime's views
The texture pass's question whether a staged texture's memory is all there
is still put to Windows for textures made at an address the title mapped
(the console's usual placed textures; a question per 256 pages). The
runtime's views of physical pages answer it where they cover the memory, as
they already answer `mapped_bytes` for placed views: one look, under a
microsecond where Windows took 3 us (350 KB), 135 us (22 MB) and 647 us (22 MB,
1 MB there) (look_costs on this PC). Windows is asked only where no view
lies. `VICTORY_MAPPED_BY_VIEWS=0` asks Windows, as for `mapped_bytes`;
`VICTORY_STAGED_ASK_ALL=1` still asks Windows of every texture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:06:49 +05:30
readmet3xt-labandClaude Opus 5.5 c1d1b4ee76 Texture queue census: slots waiting for a look again are not waiting for their memory
The census counted a slot uploaded whole and waiting for its looks again
(RECHECK_FRAMES 4, 12, 40, 120, 400 frames: in the queue up to 576 frames
after its upload) as "waiting for their memory", and its old write as "the
oldest". In coolfox-20261126-223059 at 17:02:04 the queue line said 19,277
waiting for their memory when the looks that had found memory not there
numbered 1,700 in the whole run (17:01:45: 6,842 vs 104; 17:01:59: 19,023 vs
471): nine in ten or more of them were uploaded textures waiting for a look
again, not streaming. They are counted apart now ("uploaded whole and waiting
to be looked at again"), and "the oldest" is of slots not uploaded yet.

A new 5-second line says how late first uploads are: slots served for the
first time at their first look, with the frames they had been due before the
pass took them (the pass's own lateness: its time cap), and slots served
after their memory was found not there, with the frames since their write
(streaming: mapping that came late).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:03:25 +05:30
readmet3xt-labandClaude Opus 5.5 36c4c3746c Texture pass: ask whether a staged texture is all there only at title addresses
`texture::staged(_, ask)` asked Windows whether every page of the texture's
memory is there (QueryWorkingSetEx per 256 pages, and a one-byte read of each
page not in the working set) for every texture object the pass took: 20,000 to
57,000 every 5 seconds, most of them slots read through tables, which the pass
only marks done. A whole run found 66 not all there. The pass's unattributed
time followed their count: rest = 400 ms + 12.7 us x tabled slots per 5 s over
the run's lines (coolfox-20261126-223059, e.g. 17:02:57 57,760 -> 1,136 ms,
17:03:58 17,786 -> 629 ms). Measured here (pass_costs): 18-111 us for 1-16 MB
resident, 0.9-15 ms when the pages had been trimmed.

Only a resource made at an address the title mapped can lose its memory while
it lives; a committed resource's memory and a heap's are allocated and zeroed
whole when made. So the question is asked of those alone
(`resource::at_title_address`); `VICTORY_STAGED_ASK_ALL=1` asks of every
texture, as before. Expected: the cutscene's 846 ms "rest" per 5 s drops by
about 13 us x the tabled slots (400-700 ms), gameplay's ~690 ms by ~250 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:58:37 +05:30
readmet3xt-labandClaude Opus 5.5 0b651fa9a8 Texture pass: tell its "rest" apart (5-second line), waits for its locks
The pass over textures picked by index logged 846 of 1,408 ms (cutscene,
coolfox-20261126-223059) as "the rest". A second line now splits it:
telling the queue what came of each slot, reading the slots' records,
fingerprints after uploads and same-looks, handing first uploads to the
copy queue ahead, slots shown after their upload / flipped / made at once,
asking whether a staged texture's memory is all there, other checks; the
waits for the queue's and the views table's locks (by the pass and by other
threads, counted only when the lock was held: try_lock first); the work
before the loops (not in "all"); passes by kind (frame, early, bake) with
their time and how many stopped at their time or bytes; and the slots taken
by outcome.

The existing parts are summed in nanoseconds now: in microseconds each short
call lost what it took below the next whole one.

The pass reads the slot's view once for its placed and object checks (it
read it twice).

pass_costs (ignored test, a measurement): on this PC asking whether 1/4/16
MB of resident memory is all there takes 18/23/111 us, 0.9-15 ms when the
pages were trimmed from the working set; a fingerprint 3-7 us.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:56:37 +05:30
readmet3xt-labandClaude Opus 5.5 2f81d0c85b VICTORY_WC_NO_BACK_MIN_KB: only copies at least this large leave shader writes on the card
With VICTORY_WC_NO_BACK=1 for every write-combined copy, cutscenes on the
4070 SUPER went near black (run xd-wcnoback): small results the title reads
back came back stale. 3,245 write-combined copies, median 4 KB, 82 of 1 MB
or more, 7 of 16 MB or more (largest 90 MB). Leaving only copies of 1 MB or
more on the card keeps the image (fixed frames equal to the plain run) and
the saving: with DLSS Quality, gameplay 38.3 -> 33.3 ms, cutscene median
47.3 -> 36.3 ms, p95 205 -> 142 ms, title's busiest thread 57 -> 47% of a
core (runs xd-base-b, xd-wc1m; 16 MB: 35.3 ms, xd-wc16m).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:24:42 +05:30
readmet3xt-labandClaude Opus 5.5 4fcaebdb5a DLSS on Series X at 1440p: the title's FSR4 context made at the shipping sizes
The title's shipping FSR4 carries only the Series S fixed-resolution quality
tables (1280x720 in, 1920x1080 out). At the 1440p output with the FidelityFX
path patched in, its context creation failed ("Shipping FSR4 configuration
mismatch"), our hook saw no context, and the title divided by zero at its
first upscaling (0xc0000094, runs x1440-dlssq, -dlssq2). With DLSS taking the
upscalings, the context is now made at the shipping sizes and DLSS gets the
sizes the title asked for; a dispatch DLSS does not take on such a context
runs no upscaling instead of the title's FSR4 at a size it cannot do.

Run x1440-dlssq3 (VICTORY_DLSS=1, quality, 1706x960 -> 2560x1440): 1.00 DLSS
upscalings a frame, none failed; gameplay 43.8 -> 38.1 ms, cutscene median
50.3 -> 41.3 ms, p95 319 -> 108 ms against x1440-base2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:01:02 +05:30
readmet3xt-lab 89dca0a59c Merge agent/dlss: DLSS Super Resolution through the title's FidelityFX dispatch (VICTORY_DLSS), DLSS Frame Generation (VICTORY_FRAMEGEN), both off by default; Streamline loaded at run time from outside the repo
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/host.rs
2026-11-26 20:26:47 +05:30
readmet3xt-labandClaude Opus 5.5 24d6bbb876 VICTORY_FSR_PATH=1: the title's FidelityFX path with its own upscaling, for comparing with DLSS
The image is patched to the FidelityFX path at VICTORY_DLSS_MODE's scale
as for DLSS, without Streamline: on Series X what that path looks like
and costs by itself, so that a fault seen with DLSS can be put on the
path or on DLSS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:25:34 +05:30
readmet3xt-labandClaude Opus 5.5 33f1c647eb docs: DLSS and DLSS Frame Generation setup, switches, how it works, limits
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:22:58 +05:30
readmet3xt-labandClaude Opus 5.5 d11233aa22 The title's FidelityFX calls through ours, its FidelityFX path on Series X (from DexNom's fork)
With VICTORY_DLSS=1 or VICTORY_FRAMEGEN=1 and Streamline available, the
executable's imports of amd_fidelityfx_loader_xbox.dll (ffxCreateContext,
ffxDestroyContext, ffxQuery, ffxDispatch) are bound to ours, which call
the title's own DLL for everything and give an upscale dispatch to
victory_gpu::streamline: DLSS takes it (the title's is not called), or,
with frame generation alone, its inputs are noted and the title's runs.
The title's upscaler context stays its own, so its upscaling runs again
on any frame DLSS does not take; each reason is logged once.

Series X never uses that path by itself: no Series X run (stock or
1440p) loaded amd_fidelityfx_upscaler_xbox.dll, every Series S run did.
The renderer selection (title+0x7e9421) takes the FidelityFX path,
renderer 7, only on a Series S (title+0x75140 tests the device type for
6); Series X takes renderer 6, the title's own temporal pass. The title
sizes the FidelityFX path's scene itself (title+0x28ef69a: its scale
times the output size), not through ffxQuery. So with DLSS or frame
generation available, native_1440p::prepare_upscaler patches renderer 7
in and the scaled branch to VICTORY_DLSS_MODE's scale (dlaa 1, quality
2/3, balanced 0.58, performance 1/2, ultraperformance 1/3; noted as the
FidelityFX quality mode), and the temporal scene scale to the same, with
the 1440p output kept (images/native-1440p-upscaler-<mode>-sdr) or on
its own (images/upscaler-<mode>). Each instruction is checked against
the stock bytes first; the test does so with the retail executable.
Without Streamline the image is patched as before.

`victory upscaler-check [--device] [--present]` checks Streamline, DLSS
and frame generation on this PC without the title.

The FidelityFX description layouts and the image patch of the FidelityFX
path are ported from DexNom/VIctory (crates/victory-hle/src/modules/
fidelityfx.rs, apps/victory/src/native_1440p.rs prepare_fsr_4k,
GPL-3.0-or-later); here the title's DLL keeps serving the API and the
1440p output stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:22:58 +05:30
readmet3xt-labandClaude Opus 5.5 fc8b9caeb3 DLSS and DLSS Frame Generation through NVIDIA Streamline (switches, GPU side)
VICTORY_DLSS=1: an upscaling the title asks for is recorded by DLSS
Super Resolution at the same place of the title's command list, from the
same colour, depth, motion vectors, exposure and reactive mask into the
same output: a step of ours in the list (list::external; with
VICTORY_THIN=1 an op in the list's stream, run where it is translated),
the inputs prepared as a compute shader's would be, moved to the states
the title gave, handed to slEvaluateFeature as local tags, the title's
draw state set again after. The DLSS mode follows the render and output
sizes (the smallest whose optimal size holds the render); preset from
VICTORY_DLSS_PRESET; constants from the dispatch (jitter, motion-vector
scale, near, far, field of view, reset, context flags).

VICTORY_FRAMEGEN=1 (needs the line of submissions): the device is handed
to Streamline, the direct queue is made through its device proxy and our
swap chain through its factory proxy (manual hooking, nothing hooked
globally). A host list that recorded an upscaling is noted; at its
submission its depth and motion vectors become the latest, and the next
present tags them (states the submissions left them in), sets constants
and the latency markers, and switches frame generation on; off on
presents without an upscaling. Series S's interface plane is tagged as
the interface over the scene plane.

Streamline is loaded at run time from VICTORY_STREAMLINE_DIR (default
C:\dev\sdk\streamline-sdk-v2.14.16\bin\x64) after an Authenticode check,
with no downloads; anything missing leaves the title's upscaling and our
present as they were. The C ABI is written by hand from the SDK 2.14
headers (offsets asserted as the SDK asserts them); no NVIDIA file is in
the repository. Log lines: support and requirements, feature versions,
the first recording and every change of mode or size, per second the
upscalings done, failed and left to the title, frame generation on/off,
frames shown and status. streamline::check backs `victory upscaler-check`.

The external-work helpers (host textures in a given state, inputs
prepared as for a compute view, output written on the host) are ported
from DexNom/VIctory (crates/victory-gpu/src/external.rs,
GPL-3.0-or-later); the FidelityFX state mapping is from its
fidelityfx.rs.

Not run with the title yet: `victory upscaler-check` (no device) loads
Streamline 2.14.16 on the RTX 4070 SUPER, driver 621.01: DLSS, DLSS
Frame Generation and Reflex supported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:22:46 +05:30
readmet3xt-labandClaude Opus 5.5 2393ebb0ee Merge agent/guards: write faults without the guards' lock (VICTORY_FAULT_UNLOCKED), hot blocks rest (VICTORY_GUARD_HOT), fault book reader
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:07:54 +05:30
readmet3xt-labandClaude Opus 5.5 735a34f606 Merge agent/async: two host queues planned in dry run (VICTORY_ASYNC_QUEUE=plan), compute-queue time in the timeline
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:01:48 +05:30
readmet3xt-labandClaude Opus 5.5 fa88dc7c84 Two host queues: a plan for the title's compute queues (VICTORY_ASYNC_QUEUE=plan, off by default)
The gameplay frame is about 45 ms with the card busy most of it on about
11,000 small commands at 130-140 W of 220; a timeline (tl.190) had the
submission the title waited for stand 7.2 ms sent and not begun behind
other work on the one direct queue. The title runs part of its work on
compute queues of its own, which on the console overlaps its drawing.

The queue itself is not built: a D3D12 list runs only on a queue of its
own type, the type is fixed when the list is made, every host list is a
direct list, and what the layer records into the title's compute lists is
not all something a compute list may hold (textures shaders read are put
in both read states, 0x40|0x80; depth twins are copied through a drawn
pass). A submission cannot fall back to the direct queue once its lists
are compute lists. This is the half that can be had without that:

- host/two_queues.rs: Plan::place, the order between a direct and a
  compute queue: the queue each host submission would go to, the value
  signalled behind it, and the one wait put before it (left out where the
  queue waits behind that value already, or the submission has finished),
  for copies in the card's memory (sends and compares in one order), steps
  on the card, textures named on both queues, memory values a flight of
  the other queue writes (late_met_by), tile mappings, a texture's drawing
  state moved on the direct queue first, and submissions of ours.
- With VICTORY_ASYNC_QUEUE=plan (or =1, which says it is not built) the
  frame line "two host queues, planned per frame" counts submissions by
  the title queue's type, what keeps compute submissions on the direct
  queue, those that would go to a compute queue (with and without a wait)
  and the waits by reason. Nothing runs differently.
- The title queue's type reaches Host::submit (two_queues::for_title from
  the line's thread and the older paths; the queues' types by address,
  queue::kind_of); a value job in the line knows its queue.
- Diagnostics: the timeline's summary says how much of the card's running
  time was the title's compute queues' submissions (the most a queue of
  their own could run beside the rest).

Tests: the plan's order (eight cases). The two failures in indirect::tests
are as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:00:25 +05:30
readmet3xt-labandClaude Opus 5.5 d900cb8bf5 scripts/faultbook.py: reads the books of write faults (VICTORY_FAULT_BOOK)
Per book: faults a frame under the guards' lock (waiting, holding) and
without it (VICTORY_FAULT_UNLOCKED), by thread; blocks by the number of
frames they faulted in, and those that fault in three frames of four
(what VICTORY_GUARD_HOT would leave open); the time from a block's taking
to its next fault (what a longer VICTORY_GUARD_REST would leave out); the
busiest places in the code. Standard library only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:59:30 +05:30
readmet3xt-labandClaude Opus 5.5 71fb27233d Blocks the title writes again and again rest longer (VICTORY_GUARD_HOT=<ms>; off)
Nearly every block a frame makes read-only is written again and faults:
321 to 1,017 blocks made read-only and 323 to 331 guard faults a frame in
play (logs coolfox-20261126-155824 and -172435), each fault a change of
protection on a title thread and each guarding one on ours, under the
guards' lock. With VICTORY_GUARD_HOT=<ms> a block that a write fault
opens within that time after its last rest ended rests that long
(VICTORY_AB naming it turns it on and off; 50 ms when no time is given).
A block that rests is told as written at every asking, as for
VICTORY_GUARD_REST, so no write is missed: it is copied at each refresh
that takes it while it rests. The entries of a range whose mapping
changes are forgotten.

Test: a block written again soon after it rested is left open and told
at every asking at both views, and guarded again when its rest is over.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:59:30 +05:30
readmet3xt-labandClaude Opus 5.5 3f55056817 Write faults open guarded blocks without the guards' lock (VICTORY_FAULT_UNLOCKED=1; off)
Of 281 ms the title's threads spent in the write-fault handler over 14
frames of play, 252 ms were waits for the guards' lock (timeline tl.190;
tl.130 and tl2's tl.185 the same): faults queued behind other faults and
behind refreshes guarding, up to 5 ms, while a fault's own work took 8
microseconds at the median.

With the switch a fault takes the block's bit in OPENING (whoever finds it
set waits up to 100 microseconds for that fault, then goes the locked
way), tells the other views of the page as written when the block is
guarded with them (ALIASED, a mirror of Guards::aliased: TOLD and BESIDE
set, PUBLISHED cleared), clears the block's PUBLISHED, sets its BESIDE,
changes the protection itself and queues the block. The next holder of
the lock settles the guards' notes before anything else (guards ->
settle). Until then the holders of the lock treat OPENING and TOLD blocks
as written and leave them as they are (guard), publish takes its bit back
if it finds one, and protect_alias does not count an OPENING block as
read-only for another view. OPENING's doc comment gives the argument.

Also: BESIDE is forgotten when the mapping of a block changes (the block
is told as written then anyway; a bit left behind kept a hole mapped at
the address from being known by its bits). asked_for! moves to switch.rs
for both files. Diagnostics: the line of the trackers' lock waits counts
faults opened under the lock (waiting, holding), without it, and those
that went the locked way after all; the fault book has What::Unlocked.

Tests: the single-thread tests whose writes fault, again with faults
that take no lock; the many-askers test with all and half the writers'
faults taking no lock; a fault settled by the next holder; what holders
do with an unsettled block; eight threads faulting on the same blocks at
once through two views; ranges of bits cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:59:20 +05:30
readmet3xt-labandClaude Opus 5.5 6e08fb3103 Merge agent/indirect: consecutive ExecuteIndirect calls joined (VICTORY_INDIRECT_MERGE, off by default), candidates counted in release
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:44:57 +05:30
readmet3xt-labandClaude Opus 5.5 28f6e25210 Indirect executions joined (VICTORY_INDIRECT_MERGE=1, off) and counted
An execution of one record that follows another on the same host list is
recorded with it as one ExecuteIndirect of more records when nothing could
tell them apart: no title call that records into the list between, binding
calls between that set what was set (State::rebinds), no count buffer and
one record each, same kind and host pipeline, no clamp pass recorded for
it (batch slot or window hit), the run's last binding left the list's
epoch where it found it, and the record lies next to the run's last in the
same scratch buffer at the run's step (batch slot or window step; the run
is recorded with a signature of that stride).

The run's execution is held back on the HostList and recorded before
anything else: every title call that may record (list::host_list), the
clamp passes and bindings of later executions, and the list's close.
Calls that only change the binding (pipeline, heaps, tables, views,
constants, vertex and index buffers) no longer count as title calls and
record nothing; they count their real changes instead.

A release frame line counts every indirect execution by verdict, with the
switch off too: how many could join the one before them, how many were
joined, and what kept the others apart (first on the list, a title call
that records, count buffer or more records, kept alone, other kind or
pipeline, clamped, binding changed, root constants only changed, binding
that changed the list, record apart).

Tests: the merge rules (11), a HostList test that records held runs at a
title call and at close and runs each record once on the card, and two
new variants of the ignored bare_command_cost measurement (each draw an
indirect execution of one record; all records in one execution).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:42:52 +05:30
readmet3xt-labandClaude Opus 5.5 c0f627e4b5 Merge agent/shaders-cost: host-wave meetings only where LDS order needs them (02384a60), cheaper meetings
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:30:26 +05:30
readmet3xt-labandClaude Opus 5.5 72a546b0f2 Merge agent/textures: lazy pool views (VICTORY_LAZY_VIEWS, off by default); mapping takes the remapping lock first
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:28:26 +05:30
readmet3xt-labandClaude Opus 5.5 f12996ca37 Lazy views of title pages (switch, off by default)
VICTORY_LAZY_VIEWS=1: the title's own mapping calls (XMemMapPhysicalPages,
and the scatter form a page at a time) note the view in the books and
tell the GPU side of it as before, and make its addresses a placeholder of
their own (a split; a VirtualQuery to make sure), but map the host view
only when something touches it. A view no one touched is let go with no
system call, and mapped again at the same addresses with none. The title
streams into its pool one call a page (365,000 calls, 25.7 s in 4 minutes
of run x1440-streamlog; 846 ms of 1.7 s on a cutscene's critical path,
timeline tl.120), DirectStorage fills the pages through views of its own,
and the page-mapping copies read the pool from the books alone.

A lazy view is made real (xmem::materialize, the books' lock only) by:
- any fault in it, the title's or ours (direct reads and writes, our safe
  copies and puts): the GPU side's fault handler, first in the process,
  asks before anything else and makes the access again
  (victory_gpu::use_lazy_views);
- the GPU side before what that handler does not see: reads and writes
  through the kernel (host::read, write_mapped, copy_mapped's title
  destinations), kernel writes the runtime announces (kernel_writing: file
  reads, DirectStorage memory destinations), guarding a range
  (watch::writes), and asking Windows whether memory is committed
  (texture::committed);
- the title's XMemVirtualQuery, XMemVirtualAlloc at an address, and
  VirtualFree, which then see a view as before.

Lock order: the remapping lock (victory_gpu::title_memory_remapping) is now
taken before the views' lock in every mapping call, so a reader that holds
the reading lock and faults into a lazy view gets the views' lock while a
mapping call waits for its lock (the old order, views first, would wait
for good). Page-mapping copies and side-by-side mapping map as before and
let lazy views go as their own. The streaming log's M line gets three more
fields with the switch: lazy views noted, let go untouched, made real.

Tests: lazy_views_are_mapped_when_touched (a read faults and maps it with
the pages' bytes; a write lands in the pages; untouched ones go without a
host view; a lazy view cut in two stays lazy at its ends; XMemVirtualQuery
maps it), a_reader_in_place_faults_into_a_lazy_view_while_a_mapping_waits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:27:11 +05:30
readmet3xt-labandClaude Opus 5.5 89cfae291b Console waves' meetings: cheaper, fewer, and none where LDS order does not count
CS_DefragHeap_ComputeRelocations took 11.9 ms of GPU time a frame with
the pair meetings of ce383f8 (run 184458, the card's time by command).
Three changes, all for console waves meeting on their own
(`with_pair_meetings`: the digest list, VICTORY_WAVE_WIDE=1):

- LDS order (`LdsOrder`): the program cut at its s_barriers; an access
  needs the host waves of its console wave to meet only when a plain
  ds_write stands in a piece it can reach or be reached from. Atomics
  among themselves and reads of what an earlier piece wrote need none.
  In ComputeRelocations the relocation pass (reads, ds_cmpst loops,
  ds_add_rtn) and the copy pass after it lose every meeting, and their
  per-lane loops are no longer taken wave-wide: 8 branches widened
  instead of 18, 50 meetings in the code instead of 138. Reads near an
  LDS atomic are not taken as alike in every lane.
- A meeting: the first lane of each host wave counts it in (one atomic
  per host wave, two a meeting), the wave polls the counter with one
  shared load behind a fence. Before: an atomic per lane to arrive and
  per lane per poll.
- An exchange is one meeting: two buffers per console wave, taken in
  turn by the count of meetings (a half writes one only after the
  meeting its partner's reads of it came before). Before: two meetings.
  A first-lane read exchanges "has a lane" and the value at once.

Other programs translate as before (900 compute programs, the same DXIL
with VICTORY_HOST_MAX_WAVE=32); ComputeRelocations validates. Tests: the
two console waves' loops still bit-exact on the RTX 4070 SUPER; a new
test for the LDS order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:24:19 +05:30
readmet3xt-labandClaude Opus 5.5 717687b43f Merge agent/perf: write-combined title memory without write-back (VICTORY_WC_NO_BACK), in mapped VRAM (VICTORY_WC_BAR)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:15:50 +05:30
readmet3xt-labandClaude Opus 5.5 50c15a145a Write-combined title memory: no write-back of shader writes, one mapped copy (switches)
The title's write-combined memory (protection 0x400: 2.2 and 3.2 GB,
0x2404) is what its CPU writes and does not read. Of the gameplay frame's
compares (coolfox-20261126-184458) seven of the eight largest ranges, about
360 of 730 MB a frame, lie in it, and 36 MB a frame of it was fetched and
merged into title memory.

- xmem notes write-combined regions (forgotten when freed or decommitted),
  `victory_gpu::title_memory_write_combined`.
- VICTORY_WC_NO_BACK=1: a copy with two sides of write-combined memory has
  no write-back: no hashes, compare, fetch or merge; what shaders write stays
  on the card. Refreshes still send whole pages.
- VICTORY_WC_BAR=1: a write-combined title buffer gets one copy in card
  memory the CPU maps (GPU upload heap, resizable BAR): refreshes write it
  through the bus, nothing is sent, no CPU side, no write-back. Counted
  with the card sides of copies (card_limits) and made while a fifth of the
  budget is free.

Both off by default. Risks (shadow.rs, wc_no_back): the title's CPU reading
what shaders wrote there reads older bytes; a page the title writes goes up
whole and takes back what shaders wrote in the same 4 KiB page; another
host copy of the same bytes does not see shader writes. The frame line says
how many MB of declared writes were left on the card.

Test: the registry of write-combined regions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:14:48 +05:30