Skip to content

VIctory-Neo picks: fault lock, one-page ask, retired queues, AVX2 refresh compare, waterfall by shape (all off by default) - #21

Open
oceansde012 wants to merge 6 commits into
mainfrom
claude/project-thread-9u5gpr
Open

oceansde012 wants to merge 6 commits into
mainfrom
claude/project-thread-9u5gpr

Conversation

@oceansde012

@oceansde012 oceansde012 commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Requested by Vlad · project thread

Source: KyleS98/VIctory-Neo (GPL-3.0-or-later) — 39 fps in the prologue cell on a Ryzen 9 9950X3D + RTX 3090 Ti, Series S, no DLSS / frame gen, but its victory play defaults skip two shader passes (VICTORY_LEAVE_OUT) and use VICTORY_AMBIENT instead of RT — so that number is not comparable to our base and the config is not taken. Per-commit gains below were A/B'd on that config. Report: reports/victory-neo-2026-11-28.md (project files).

What

Five clean cherry-picks onto f4b48ad (-x, authors kept), then a gating commit (DeepSeek) so no switches = f4b48ad:

Switch Source What Their measurement
VICTORY_FAULT_UNLOCKED=1 foxhound 3f55056 (already off by default) write faults open guarded blocks without the guards' lock 29.87 → 28.97 ms
VICTORY_PAGE_ASK=1 Neo 0fb1e38 write fault asks QueryWorkingSetEx about one page, not VirtualQuery over the region title threads 17 → 3 ms/frame
VICTORY_RETIRED_QUEUES=1 Neo 9165dd0 32 per-thread retired queues instead of one lock 3.3 ms of 22 per recording thread
VICTORY_WORD_RUNS=1 Neo 3a6b62e (VIctory-NVIDIA #145) AVX2 compare at two refresh sites (submit thread) noise
VICTORY_WATERFALL_SHAPE=1 Neo 37b0ace translator proves 32k more waterfall loops; card 27.6 → 24.4 ms/frame. Joins the shader cache key picture risk: dark wall patch was suspected once

Env-only, already in base: VICTORY_CARD_AWAKE=0, VICTORY_STORE_BESIDE=1.
Not taken: LEAVE_OUT / AMBIENT defaults, build flags c800cb2 (LTO / x86-64-v3 / mimalloc, can't be a switch), VICTORY_OWN_CPUS (2-CCD CPUs only), Series S own upscaler ba0b1dc (picture change, needs A/B), XCL files.

Checks

  • Windows target cargo check --workspace --all-targets: OK, 17 warnings (same as base).
  • cargo test -p victory-shader: 209 passed.
  • Not run in game (PC tests paused).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FLuVRmoPqty3gMWAGg1Bbv

readmet3xt-lab and others added 6 commits November 28, 2026 14:05
…ULT_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 <noreply@anthropic.com>
(cherry picked from commit 3f55056817bfc596fc81bafa68f2f263172f4a65)
…ion around it

A write fault of the title's on a block that another of its threads has
just opened, or is opening, asks whether the page is writable by now. It
asked with `VirtualQuery`, which answers for the whole run of pages around
an address that are alike and walks to the end of it: for a view of hundreds
of megabytes hundreds of microseconds, with the address space held against
every change of protection meanwhile.

`writable` now asks about the one page (`QueryWorkingSetEx`), and about the
region only where the system does not have the page in memory.
`VICTORY_PAGE_ASK=0`: the region, as before.

Measured by turns in one run (prologue's cell, RTX 3090 Ti, Ryzen 9 9950X3D,
Series S profile, 12 seconds a turn), per frame: 170 to 185 questions about
regions, 15.5 to 17.3 ms of the title's threads' time, become 415 to 567
about pages (the wait for a block being opened asks more often in its 100
microseconds), 2.8 to 3.3 ms. The frame itself did not move by more than two
runs differ by (26.80 and 26.70 ms): the title's own threads, the thread that
prepares submissions and the card each take about that long there.

AI-assisted (Claude Code, Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 0fb1e38eeea8735d8e9889af5ccd825f07908e4c)
Host objects the title lets go of while a submission may still use them
wait in a queue until that submission has finished. There was one queue
under one lock, and the eight threads that record the title's lists each
let go of thousands of descriptor slots' resources a frame (some 20,000 in
all): a push of nanoseconds each, but a thread that finds the lock taken
sleeps and is woken 50 microseconds later or more.

A profile of the prologue's cell (RTX 3090 Ti, Ryzen 9 9950X3D, Series S
profile) had each of those threads 3.3 of the 22 ms a frame it works in that
wait, and the thread that prepares submissions 0.7 ms. Now each thread
that retires takes one of 32 queues in turn; what finishes a submission
looks through all of them.

In one run with switches changed by turns the build with this and the two
commits before it ran the same scene at 30.47 ms a frame where the build
without them had 32.60 (both with VICTORY_CARD_AWAKE=0, diagnostics builds).

AI-assisted (Claude Code, Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 9165dd03eb85432d691594d76df8a157fa960149)
…ed word by word

`put_changed` and the refresh of a copy's stale pages found their changed
runs with `dword_runs`; `word_runs` gives the same runs (its test says so)
32 bytes at a time where the processor has AVX2.

The change is trustno1-coder/VIctory-NVIDIA#145 by lido772, who measured
2.61-2.63 -> 2.40-2.41 microseconds a span there. Here it is within the noise
of a run (measured together with the build change before it).

AI-assisted (Claude Code, Claude Fable 5.2).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 3a6b62e5e986206cbefde1cd7b884aaa8fb365aa)
…oven by its shape where the per-lane form cannot follow it

The console compiler loops over a per-lane descriptor by reading the
first active lane's table offset, narrowing EXEC to the lanes with the
same one, loading that entry and dropping those lanes. `track` makes each
lane load its own entry when `Tracer::waterfall` proves the loop. In the
title's programs it mostly cannot: over all 25,760 programs it emits,
44,874 such loops were refused, 37,605 of them because the per-lane form
could not show that the compares select the access's lanes and 209
because it could not show that the retry keeps the lanes still waiting.
In a wave of 64 run as two host waves of 32, every pass of an unproven
loop exchanges the first lane's value and the mask between the halves:
four group barriers a pass.

`Tracer::waterfall_shape` proves the loop by its exact shape instead,
only where `waterfall` refused: one block that branches to itself, with
nothing in it but the first-lane reads, `v_cmpx_eq` of each with the
same lane value, the table loads, waits, accesses that only read, and
`s_andn2_wrexec` of a mask T with itself. T is shown to be EXEC on every
entry from the phis (a move of the loop's own entry EXEC from outside;
the same retry on the back edge), and the first-lane value is read
nowhere past the loop.

It proves 32,106 of the refused loops. The same programs are emitted as
before, and the DXIL validator gives the same results as before for all
of them.

Measured in the prologue's cell (RTX 3090 Ti, Series S profile, one run
each way unless said): where the card is the limit the frame gets 2.5 to
4 ms shorter. With the title's own upscaler (#68), 30.8 fps before and
33.3, 32.9 and 32.0 after; with DLSS Quality and FSR 3 frame generation,
27.0 rendered before and 30.8 after. On main alone without DLSS, where the
translated FSR 4 path keeps the preparing thread at 27 to 28 ms a frame,
28.5 before and 28.7 after. The costliest program of the frame,
vfx_proj_decal_vbuffer:CS_ProjDecalReduceClassification_Scalarized
(4.1 ms a frame in a timing run), has 27 such loops; its DXIL goes from
149 group barriers to 41.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 37b0acebc4368e5e6603c0c5dad370a28ae55e36)
…behind switches (off by default)

With none of the switches set the behaviour is that of f4b48ad:
- VICTORY_PAGE_ASK=1: a write fault asks QueryWorkingSetEx about its one page (Neo 0fb1e38; on by default there).
- VICTORY_RETIRED_QUEUES=1: 32 per-thread retired queues (Neo 9165dd0); off: queue 0 only.
- VICTORY_WORD_RUNS=1: AVX2 word_runs at the two refresh sites (Neo 3a6b62e); off: dword_runs as before.
- VICTORY_WATERFALL_SHAPE=1: translator proves waterfall loops by shape (Neo 37b0ace); joins the shader cache key.

Switch gating written by DeepSeek (deepseek-v4-pro).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FLuVRmoPqty3gMWAGg1Bbv
@oceansde012 oceansde012 self-assigned this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants