Skip to content

DEBUG, do not merge (mesh pipeline) - #165

Closed
pablogonz12 wants to merge 35 commits into
mainfrom
scratch/mesh-102
Closed

pablogonz12 wants to merge 35 commits into
mainfrom
scratch/mesh-102

Conversation

@pablogonz12

@pablogonz12 pablogonz12 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Debug run for PR 102's Windows mesh pipeline failure; closed after reading the log.

Summary by CodeRabbit

  • New Features
    • Added an optional on-screen FPS counter and expanded graphics diagnostics, including frame captures and profiling reports.
    • Added profile options for render scale and upscaler selection, plus conditional hooks and image-relative addresses.
    • Added offline shader-cache warming through the translation command.
  • Improvements
    • Improved texture handling and GPU memory use, including optional on-demand texture allocation.
    • Updated shader translation and rendering behavior for improved compatibility.
  • Documentation
    • Expanded title-profile guidance for switch conditions and hook settings.

fxceless and others added 30 commits November 24, 2026 22:19
…freshed when the card is full

Two fixes for textures that shaders pick by index, both proven with a
slot listing before they were made:

- The title keeps only a texture's small levels and places the next
  texture in the address range of the absent large ones. Described at full
  size every neighbour overlapped, and each view written took the textures
  beside it out of the upload queue and made their host slots null (tens
  of thousands of slots a run). A newer view now makes an older one stale
  only when it starts within that one's first 4 KiB.
  VICTORY_STALE_TEXTURES=overlap: the old rule; =0: never. Unit tests on
  the span table alone. The first room is lit with its walls and the
  characters' textures in the first launch with it.
- With the card at its limit, a texture that already has its host copy is
  uploaded again when the title changed its memory (it took no new card
  memory, and was refused all the same).
  VICTORY_REUPLOAD_WHEN_FULL=0: as before.

Logging only, off unless asked for: both video memory groups and budget
moves; card accounting (VICTORY_CARD_ACCOUNTING=1); the slots a listed
draw's shaders read, with their state (VICTORY_LIST_SLOTS=); a trace for
the missing first-room walls (VICTORY_WALLS_TRACE=1 or 2). A card test of
what a bare command costs (ignored by default):
cargo test -p victory-gpu --release -- --ignored bare_command_cost --nocapture

Known: about 3 to 5 frames a second; more than half of the texture memory
on the card is held for levels the title has not loaded yet (next).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rites 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 <noreply@anthropic.com>
…ored, 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 <noreply@anthropic.com>
…c, draw-table slots left to their draws, no failing write-watch calls; card fetches inside their flights (off by default)

- Descriptor sync: a multiply-and-fold fingerprint of a record in place of
  BLAKE3 (35 to 42 ms a frame over 250,000 to 300,000 records), and slots
  that draws read through tables lately are left to their draws
  (VICTORY_HEAP_SYNC_TABLES=1 mirrors them too): the pass over the heap
  went from 70-220 ms a frame to about 3.
- Write watch: no kernel asking for memory the guards already hold as view
  memory (pull request #670 by Jonirulah).
- Card copies' flagged pieces can come down inside their own flights
  (pull request #648 by Jonirulah; VICTORY_CARD_FETCH_INFLIGHT=1, off by
  default). One game run with it on: no device loss, the copy-back
  thread's fetch wait 181 -> 0 ms a frame, the card busier; no frame-time
  gain claimed.
- Logging: the heap pass's texture part and buffer slots; indirect compute
  dispatches over 65,535 groups.
- README: what was measured, and that pull request #220 with
  VICTORY_INDIRECT_WINDOW=1 lost the device twice here and is not in.

One five-minute game run of this tree's source on an RTX 4070: no device
loss; the frame is still 250 to 380 ms (the card is the limit). This
merged tree was built; its test suites were not run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…queue for fetches, indirect draw windows made safer, a profiler; all behind switches

- VICTORY_ASYNC_SUBMIT=1: submissions are prepared and sent by a thread of
  the layer, in order, instead of by the title's render thread; the
  queue's line stays open while its head is prepared.
- VICTORY_QUEUE2=1: fetches of what shaders wrote to copies in the card's
  memory go to a copy queue, with the fix for a piece fetched beside a
  later flight (fetched again when that flight lands).
- Pull request #220 (cheaper indirect draws) is in, its windows off by
  default; a draw record of 2^23 vertices an instance or more runs empty
  (its window checker found one list drawing 90 such records).
- Fills of upload memory and read-only title buffer copies no longer wait
  for flights; each is checked against what the flights then wrote, and
  the first mismatch turns the waiting back on (VICTORY_FILL_WAIT=1).
- Up to 512 idle host lists and the texture staging buffers are reused.
- VICTORY_MERGE_GAP / VICTORY_MERGE_RUNS (off / 512 by default; the gap
  form is not exact, see its comment).
- VICTORY_PROFILE=1 (diagnostics builds): a sampling profiler inside the
  layer.
- README: what was measured, the history of the device losses with
  windows, and what is still open (frame rate dips; cause not known).

Measured on an RTX 4070 in the first room: about 3.5-4 frames a second
before, 6-7 with all the switches, defaults about 4.5-5. Five runs with
windows on since the fix, no device loss. This merged tree was built; its
whole test suite was not run (the tests around flights, queues, indirect
draws and the copy queue were, on the development tree).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…atch, a forbidden self-copy removed; draw windows measured at 6.0 -> 8.9 frames a second

- VICTORY_FRAME_LOG (on in diagnostics builds): every frame's length, and
  what the usual frame and each long frame were made of; VICTORY_CARD_METER
  adds the card's time by kind of list.
- VICTORY_CAPTURE_WORLD_EVERY: a saved frame costs 235 ms inside the
  present, which was the regular dip of test runs (every 8th frame).
- A driver watch (VICTORY_DRIVER_WATCH=0: off): entries of a display driver
  in the system's event log are logged as they are recorded; the first one
  turns draw windows off for the rest of the run. Every device loss here
  was announced that way 2.7 to 55 seconds ahead.
- A copy between two title textures that share one host texture is left
  out (the host does not allow a texture copied onto itself): 402 in a
  five-minute run.
- The list of shader-visible heaps is a reader-writer lock; the heap sync
  takes a changed page's records under one lock; guarded view memory is
  left out of the write-watch askings ahead (after triippywhale cc368c7c,
  d0581a55).
- Behind switches, off by default: VICTORY_COPY_PLAIN, VICTORY_REFRESH_ONCE
  (after upstream 6d021fe), VICTORY_VIEW_KNOWN, VICTORY_BACK_OWN_VIEW,
  VICTORY_ASYNC_PRESENT, VICTORY_BVH_HOLD (refused: the picture loses its
  indirect light), VICTORY_CARD_REHASH_RUNS=alt.
- The process opts out of the system's efficiency mode.
- README: what the instruments measured and what is still open.

Measured on an RTX 4070 in the first room: 6.0 frames a second on average
with windows off, 8.9 with VICTORY_INDIRECT_WINDOW=1 (one run each, the
second with the driver watch; no driver entry, no device loss). This merged
tree was built; the unit tests of the changed parts were run on the
development tree, the whole suite was not. One test of the indirect budget
on the software adapter is flaky (it was before these changes).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d a corrected comparison of draw windows

- VICTORY_COPY_PLAIN=1 also serves reads of title memory into buffers of
  the layer; reads under 256 bytes stay with the kernel and a source that
  faulted is left alone for two seconds (the first form took the layer's
  one-byte askings too: 1,000 to 1,300 faults a frame).
- The submit and copy-back threads ask for the fast cores of a hybrid
  processor (VICTORY_FAST_CORES=0: not).
- VICTORY_DISK_CORES=slow (off): the DirectStorage workers ask for the
  slow cores.
- README: the 6.0 against 8.9 frames a second given for draw windows
  compared runs in different scenes and is withdrawn; frame time against
  draws per frame is given instead. A first play session past the first
  rooms lost the device in the open world with the card out of room for
  new textures; cause not known.

Measured on an RTX 4070 (one run each): at 4,500 draws a frame 145 ms with
windows off, 124 ms with windows on and copies in place; 7-8 frames a
second in the first rooms, 10-12 in lighter views. No driver entry, no
device loss in that run. This merged tree was built; the unit tests of the
changed parts were run on the development tree.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… our own view (9.6 fps in the first rooms)

- Meters: how the title paces itself on its fences (fence.rs pace, console_insn.rs mwaitx
  waits and exceptions by kind), the card's time by list and by pipeline (cardmeter.rs),
  indirect commands by what became of their clamp, switches that alternate inside one run.
- VICTORY_JOIN_PARTS=1: parts that follow one another in the queues' lines go to the host
  as one submission (29 -> 9 a frame), about 6 %.
- VICTORY_BACK_OWN_VIEW=1 measured and proved (VICTORY_BACK_OWN_CHECK=1): about 9 %.
- The 15-byte clzero loop is taken whole; a section handle's number coming round again
  forgets our view of the earlier section.
- Measured at nothing, left off: REFRESH_ONCE, ASYNC_PRESENT, VIEW_KNOWN, SPREAD,
  QUEUE2=3, WINDOW_JUMP.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…THER=1): 10.3 fps in the first rooms

- A single indirect record that misses its window gets a slot that the list's prelude fills
  in one clamp pass by a table of offsets; proved by re-clamping every gathered record at its
  draw and comparing on the card (7.9 million, none differed).
- Gathering ends at a dispatch or at a draw whose shaders can store to buffers; why a record
  got no slot is counted.
- README: the card's time added up (about 50 ms a frame are the title's own passes as
  translated).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… card copies (off)

- fpsbox.rs: the frame rate drawn into the top left corner of every frame shown, for
  captures of the picture (VICTORY_FPS_COUNTER=0: not).
- VICTORY_COPY_CHANGED=1: a refresh of a copy in the card's memory sends on only the
  256-byte chunks that differ; measured, no net gain yet, left off.
- README: the numbers so far are the scene standing still; while the title streams, half
  the time goes to frames in which the card is idle.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ueue, levels on demand)

Merge fxceless's eight commits after c96b4f2 into unify/fork-core. Policy,
as in #88:

- victory-gpu, victory-shader, victory-hle: fxceless's newer tree, whole
  (the same author's later work on top of the line #88 took a snapshot of).
- victory-loader: our profile-driven hooks; the XCL GPL-2.0-only
  console_insn files stay removed (upstream still modified theirs).
- apps/victory: both --warm (levels on demand warm-up) and our --host-lanes.
- README, docs, launcher, CI, policy: ours.

Co-authored-by: fxceless <fxceless@users.noreply.github.com>
…page mapping, both taken back out

The mean while the title streams is 4.5 frames a second; its page-mapping copies cost 32 ms
of every cutscene frame in kernel map and unmap calls. Leaving unchanged pages alone finds
none; mapping pool pages in a row as one view halves the calls but broke faces in 3
launches of 3 and is reverted (no code change in this commit).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ewer line needs

The merge above left our older fork-line modules (switches, writeback,
pipeline warm-up, scissor, producers, dxc, raw_view_tests) next to
fxceless's newer files, which neither declare nor call them; both feature
sets of the same author's work cannot compile against each other's host.

- victory-gpu, victory-shader: fxceless's tree at 3973179, whole
  (the same modules' newer versions replace the older ones).
- The pipeline warm-up (`victory warmup`, `VICTORY_WARMUP`) is gone with
  them; the newer line warms the shader cache instead
  (`victory translate --warm <file>|all`), which stays.
- Five lints the newer files trip on our toolchain: a diagnostics-only
  counter gets the tree's usual `cfg_attr(not(feature = "diagnostics"))`,
  one sort by key, two `is_multiple_of`, one test-only field.

`cargo xwin clippy --workspace --all-targets --target x86_64-pc-windows-msvc -D warnings`: clean.

Co-authored-by: fxceless <fxceless@users.noreply.github.com>
…ger blend bypass

(cherry picked from commit 474e2fcc0fd7c451d9e0f399d133c804a41610d7)
Ports the levers behind Wasler's `6d48a4322` (itself from vitutu1 /
ZigZagBoi1's ScarlettPort) without letting the code know a title: the
patch sites, the immediate's expected bytes and the FSR constants are the
profile's, the machinery is ours.

- `render_scale` and `own_upscaler`: profile fields, `VICTORY_RENDER_SCALE`
  and `VICTORY_OWN_UPSCALER` override them (the names Wasler's branch uses).
- A hook lists the switches it needs in `when` (`!name` for "off"), so the
  patches of the upscaler's minimum, its fixed maximum, the fallback
  upscaler's scale and its maximum size are one set the profile turns on.
- `new_scale = true` writes the effective scale as an f32 (its `expect`
  gives the four bytes); `expect_from`/`new_from` read and write `base + rva`
  as an address, for places holding a pointer to the image's own code.
- `expect` and `new` are optional now: one of each per hook may be computed.

Docs: the fields, the two switches and the two computed-byte kinds.
CREDITS: Wasler's fork and vitutu1's port named.

Co-authored-by: Wasler <artemgulenko824@gmail.com>
Co-authored-by: ZigZagBoi1 <ZigZagBoi1@users.noreply.github.com>
…ion and no error

Wine's wevtapi gives EvtSubscribe a 0 and leaves the last error unset,
so the test read a zero errno as failure. On Windows the call still has to
fail with an error, and does.

Co-authored-by: fxceless <fxceless@users.noreply.github.com>
…les through it

Leaving the older fork line's `dxc` module behind with the rest of it
took the only path off the system compiler with it, and the newer line
compiles its helper shaders with `D3DCompile` alone: the indirect-argument
clamp, the card compare and the depth-plane twins (`host::compile`) and
the in-place probe. Under Wine and Proton that compiler is vkd3d-shader,
which refuses `RWByteAddressBuffer.Load` and `InterlockedMax`, which this
source uses, and drops root signatures: no clamp means no pipeline for
it, and every indirect execution is dropped, which is the one thing this
sync must not do (JMAN730/project-flamingo#586, Marvisak/VIctory#2195).

- `dxc.rs` is back as the fork line had it: the system's compiler first;
  DXC as shader model 6.0 only when it refuses the source or leaves out
  the root signature the shader asks for; `VICTORY_DXC` and `VICTORY_DXIL`
  find the compiler and the validator; a container without a digest is
  signed.
- `host::compile` and `indirect`'s `make_from` ask it, so the clamp, the
  compare, the twins and their tests take the same path; the in-place
  probe and the indirect benchmark's helper do too (both compiled with
  `D3DCompile` directly before).
- `Win32_Graphics_Direct3D_Dxc` is back in victory-gpu's manifest.

On Windows nothing changes: `D3DCompile` takes the source and keeps the
root signature.

`cargo xwin clippy --workspace --all-targets --target x86_64-pc-windows-msvc -D warnings`: clean.
…heck runs

`offline/offline-check.sh` translates its whole dump with
`cargo run -p victory-shader --example retranslate`, and the sync left the
example behind with the older tree, so off-line checking reported
`no example target named retranslate` and every stage after it had
nothing to read.

It is local tooling (not upstream): dumps -> host DXIL, `translated=N
failed=M` and the refusals grouped by stage and reason.

Over the 2,912 containers of the runtime dump: translated=2912 failed=0
(the fork line refused 5 there).
# Conflicts:
#	crates/victory-gpu/src/indirect.rs
#	crates/victory-gpu/src/pipeline/host.rs
… profile

A profile written for this branch (a hook with `when` or `new_scale`) made
an older build reject the whole file — `title profile not read: TOML parse
error at line N` — and run with none of its hooks: the two that keep the
title alive went with the three that ask for a resolution patch. Values
now, the hooks are taken out of the document and read one at a time, so a
hook carrying a field this version does not know is skipped on its own
with one warning naming it (`hook "…" not placed: unknown field …`), and
everything else in the profile still applies.

The top level is read as strictly as before (`deny_unknown_fields`: a file
that is not a profile at all is still rejected and reported), and only the
`[[hooks]]` entries are read one at a time.

- `profile::parse` does it; `load_dir` calls it.
- Test: three hooks, the middle one with a field of a later loader; the
  other two load, in order.
- `docs/title-profiles.md`: `when` and `new_scale` need this version, and
  what an older build does with a newer hook.

Checked against a copy of the live profile with the pending resolution
hooks appended (in /tmp, never the live file): `matched, 5 hooks`, 2
applied (the rest wait for their switches), imports bound with 0 missing;
a copy with one unknown field logs the one warning and still binds.
`LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR` searches the loaded module's own folder,
which the loader can only do for a fully qualified path; a relative
`VICTORY_DXC=.\sdk` passed `is_file` and then failed to load, so the
fallback still had no compiler. The path is made absolute first.

Under Wine with its builtin compiler (`WINEDLLOVERRIDES=d3dcompiler_47=b`)
the test's shader is refused by the system compiler (`0x80004005`) and DXC
compiles it: a container with a root signature and a digest, taken by the
assertions. (`cargo xwin test -p victory-gpu --lib dxc` under GE-Proton11-14:
3 passed, with dxcompiler.dll/dxil.dll from the tool's files.)
Main moved with #96 (title memory in place by default) and #99 (a table
descriptor read only as numbers). One conflict, in `emit/lower.rs`: main's
`descriptor_data` reads a descriptor's dwords as numbers where our line
still refused it (`unused_descriptor_kind`). Main's is the newer, merged
form, so it is taken and the older helper, now unused, goes with it.

DXC wiring and the profile loader merge clean.
…head

- `Hook::wanted`: a switch name the loader does not know now keeps the hook
  out whatever its negation says (`when = ["!future_switch"]` read as "on"
  through the negation, and the hook was placed when the doc says it never
  is). Test: an unknown switch, negated, places nothing.
- `Profile::render_scale`/`own_upscaler` take the environment value as an
  argument (`render_scale_with`, `own_upscaler_with`), so the tests no
  longer depend on the process environment: with `VICTORY_RENDER_SCALE=0.67`
  set they compared against 0.5. The tests also now pin what a supplied
  value does — `0.75` wins over the profile, `2` is no scale at all,
  `VICTORY_OWN_UPSCALER=0` overrides a profile that says true.
- `docs/title-profiles.md`: the two switch rows say exactly that (unset:
  the profile decides; set: the value decides, invalid included).
- `warp_budget_saturates…`: the records that fit the budget are the first
  two of whichever 64-lane group charges first, so the test accepted only
  1 and 2 (group 0). It now takes 1, 2 or 64, 65, and still demands exactly
  two kept and the rest zeroed. Run on RADV (vkd3d-proton under Wine): pass.
…eatures clippy)

The diagnostics-only counters in `draw.rs` and `watch.rs` trip
`clippy::manual_is_multiple_of` under `--all-features`, which CI runs and a
default-feature clippy here did not.

`cargo xwin clippy --workspace --all-targets --all-features -- -D warnings`: clean.
Main moved with #114, #119 and #126. Three conflicts:

- `CREDITS.md`: both sides kept — fxceless's fork, Wasler's fork (the
  interval, the gap-coalesced rehash, the integer blend bypass) and
  vitutu1/ZigZagBoi1 beside JMAN730/victory's `project-flamingo#672`.
- `descriptor/host.rs` and `texture.rs`: main's narrowed-SRV work (#672,
  #126) stands on the present-order machinery and the live `switches`
  module this line does not carry (`Order`, `Present`,
  `crate::switches::b`, `copystat::C::ViewNarrowed`, `Staging::present`),
  so the two files stay this line's. Porting that work is its own change,
  not something a merge resolution can decide. `HostHeap::copied`, this
  line's record fingerprint, is kept.
…in the card's own memory (fewer long frames in two launches of two), and what was tried and gave nothing

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…buffers in the card's memory as one buffer in a GPU upload heap (VICTORY_WINDOW_UPLOAD), and the day's smaller pieces

- Frame shot: one frame's commands, the card's clock before each, and the picture each pass left,
  with no library loaded and no wrapped device; pictures in parts when little memory is free.
- VICTORY_WINDOW_UPLOAD=1: a window that may go to the card (VICTORY_CARD_WINDOWS_MB) is one buffer
  in a GPU upload heap, filled by the CPU through a resizable BAR; asked for, self-tested and said
  in the log; falls back where the device has none.
- A pipeline library the driver rejects is kept under another name, never saved over.
- DirectStorage: reads into physical pages wait for the title's Submit when a half-full queue
  submits itself (after upstream eddde734).
- VICTORY_WIDE_REFRESH=alt and VICTORY_STAGING_POOL=alt (both measured at no gain), the staging
  counter with the pool off, a log line for windows on the card, a RenderDoc hook that did not
  survive here, a test of changed_runs against a walk byte by byte.
- README: runs 269 to 273.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main moved by fifteen commits (#110, #111, #116, #121 among them) and now
grows on the machinery this line replaced: main's `shadow.rs` asks for
`crate::writeback` and `crate::switches`, its `pipeline/make.rs` for
`super::warm`, and its `host.rs` for `shadow::skip_clean`/`clean`. Those
three live in the fork line's older shape here (the relay instead of the
write-back worker, no live switches, the pipeline warm-up gone), so the
merge keeps this line's `shadow.rs`, `host.rs`, `watch.rs`,
`pipeline/{host,make}.rs` and drops main's `switches.rs` again — the same
decision the sync took, and one that can only be undone by porting main's
usage of them, which is its own change.

`watch::written_since`, main's helper whose callers went with that
resolution, is kept for its tests and marked `cfg_attr(not(test),
allow(dead_code))`.
…d runs

The header still said 2.5 to 4 frames per second. Measured since: 8 to 10 in the first rooms
(97 to 104 ms a frame at about 3,850 draws, 122 ms at 6,774) and 5 to 8.5 through the opening
cutscene (runs 271 to 273), with the switch set of run 253, which the row now lists. README only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e more)

Same shape as the merge before: main's `switches.rs` (deleted here) and its
`texture.rs` narrowed views stay out; this line's files are kept.
`cargo xwin clippy --workspace --all-targets --all-features -D warnings`: clean.
Six commits after 3973179, on the same gpu/shader line:

- 465b94f Scattered indirect records clamped once per list (VICTORY_INDIRECT_GATHER=1): 10.3 fps in the first rooms
- ca8829f The frame rate in the corner of the picture; changed-bytes refresh of card copies (off)
- d510ee4 README: the dips while moving, measured; two attempts on the title's page mapping, both taken back out
- dd3a14b README: a frame capture built into the layer, copies of title memory in the card's own memory (fewer long frames in two launches of two), and what was tried and gave nothing
- 79cfdd9 A frame capture built into the layer (VICTORY_SHOT), windows outside buffers in the card's memory as one buffer in a GPU upload heap (VICTORY_WINDOW_UPLOAD), and the day's smaller pieces
- 085ee7c README: the frame rate in the status header brought up to the measured runs

Conflicts: `README.md` keeps this branch's (hub's Steam-tool text); the
fork's newer `pipeline/library.rs` is taken, with `create` dropped (its
caller went with it). Four lints the newer files trip on our toolchain:
three are fixed in `library.rs`/`shadow.rs`, one in the new `fpsbox.rs`
(the entry API instead of `contains_key` + `insert`).
…ommits)

43 commits of main, #98/#100/#112 among them. Resolved by keeping both sides
where they are independent, and main's where a merged Scarlight PR added
the code:

- `CREDITS.md`: ours and main's (JMAN730/victory #672) both kept.
- `victory-hle/dstorage.rs`: main's (PR #98's paged destinations, the
  `submitted` field, the retry path) whole; the fork's `pages_written`
  call had gone with it, so `xmem::pages_written` stays as an
  `#[allow(dead_code)]` helper for its tests.
- `descriptor/host.rs`: main's `checked_buffer_range` test module kept
  beside ours; main's `buffer_srv_parts`/`structured_alias`/`buffer_srv_alias`
  are refused — their caller (main's structured-view path) is not in this
  line's file, so they would be dead code here.
- `draw.rs`: both sides — the fork's `gather_close` and main's mesh grid.
- `watch.rs`/`host.rs`: main's `mapped`/`copied` copy path kept (both the
  guard set and the helpers), and the `Shader` initialiser gains `walks`.
- `texture.rs`, `watch.rs`'s write-back hooks, `switches.rs`, `writeback.rs`:
  not taken — main's narrowed-SRV work, live switches and write-back worker
  stand on `texture::Present`/`Order`, `host::hand_back_now` and the
  fork-replaced shadow internals, which this line does not carry; porting
  them is its own change. Marked as follow-up in the PR.

`cargo xwin clippy --workspace --all-targets --all-features -D warnings`: clean.
A view of ours on an earlier section was only forgotten (`VICTORY_BACK_OWN_VIEW`),
so the obsolete mapping, and its section's pages, stayed for the rest of the
process, one per reused handle number. The entry is unmapped as it leaves
the map (CodeRabbit on #102). `cargo xwin clippy --all-features -D warnings`: clean.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Changes: GPU runtime

Layer / File(s) Summary
Host transfer and runtime integration
crates/victory-gpu/src/host.rs, crates/victory-gpu/src/list.rs, crates/victory-gpu/src/plaincopy.rs, crates/victory-gpu/src/lib.rs, crates/victory-gpu/Cargo.toml
Host submission and presentation paths change, and copy-back runs inline. The host adds upload-heap and video-memory support. Identical-host-texture copies can be skipped.
Indirect execution and pipelines
crates/victory-gpu/src/draw.rs, crates/victory-gpu/src/indirect.rs, crates/victory-gpu/src/indirect/bench.rs, crates/victory-gpu/src/pipeline/*
Indirect processing adds gathered records, window checks, and scratch-state tracking. Pipeline creation uses one worker pool and adds integer-target blend handling and held-dispatch checks.
Texture and descriptor memory
crates/victory-formats/src/texture.rs, crates/victory-gpu/src/descriptor*, crates/victory-gpu/src/resource.rs, crates/victory-gpu/src/texture.rs, crates/victory-gpu/src/tiles.rs, crates/victory-gpu/src/watch.rs, crates/victory-gpu/src/inplace.rs, crates/victory-hle/src/modules/xmem.rs
Texture and descriptor paths add on-demand tiled mip levels, page-write handling, and exact-size buffer copies. The texture format walker and mapped-view tracking also change.
Shadow memory and copy-back
crates/victory-gpu/src/shadow.rs
Shadow copies gain changed-range handling, in-flight fetch support, optional upload heaps, and merge diagnostics. Copy-back preserves title changes to bytes also changed by the GPU.
Queue ordering and copy lanes
crates/victory-gpu/src/queue.rs, crates/victory-gpu/src/queue2.rs
The direct queue can defer eligible presents and join submission parts. Optional copy-queue lanes handle buffer fetches and uploads with fence ordering and landing-buffer reuse.
GPU diagnostics and pacing
crates/victory-gpu/src/cardmeter.rs, crates/victory-gpu/src/copystat.rs, crates/victory-gpu/src/fence.rs, crates/victory-gpu/src/fpsbox.rs, crates/victory-gpu/src/framelog.rs, crates/victory-gpu/src/profile.rs, crates/victory-gpu/src/renderdoc.rs, crates/victory-gpu/src/shot.rs, crates/victory-gpu/src/spread.rs
New diagnostics report frame, fence, card, and thread data. The runtime adds an FPS overlay, RenderDoc capture, frame shots, and thread-affinity controls.

Shader translation and cache

Layer / File(s) Summary
Shader cache identity and warming
apps/victory/src/main.rs, apps/victory/src/run.rs, apps/victory/src/translate.rs, crates/victory-gpu/src/shader_cache.rs, crates/victory-hle/src/modules/d3d12x.rs, crates/victory-shader/build.rs
The shader cache key uses translator fingerprints. CLI and HLE entry points add shader-cache warming, while the pipeline warm-up command and APIs are removed.
Shader lowering and emitted signatures
crates/victory-shader/src/emit/*, crates/victory-shader/src/io.rs
Shader lowering changes interpolation, wave64 half-precision sums, and mask handling. Signature rows are sorted, and tests cover the updated behavior.

Profile-driven hooks

Layer / File(s) Summary
Profile settings and hook parsing
crates/victory-core/src/profile.rs, docs/title-profiles.md
Profiles add render-scale and own-upscaler settings, conditional hooks, and image-base-relative fields. Invalid individual hooks are skipped while valid profile content remains available.
Loader integration
crates/victory-loader/src/hooks.rs
The loader evaluates hook conditions and resolves expected and replacement bytes using the image base and render scale.

HLE behavior updates

Layer / File(s) Summary
File, input, and timer behavior
crates/victory-hle/src/modules/files.rs, crates/victory-hle/src/modules/gameinput.rs, crates/victory-hle/src/runtime.rs
fread reads through temporary chunks of at most 1 MiB. Per-device input history increases to 256 readings. Timer setup includes execution-speed throttling unless the environment setting disables it.

Design-note attributions

Layer / File(s) Summary
Credits
CREDITS.md
The design notes add attributions, license details, and descriptions of work and switches associated with three external sources.

Possibly related PRs

Suggested reviewers: fxceless, fever308, r4tedx

Change: Other

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@pablogonz12

Copy link
Copy Markdown
Owner Author

Debug PR; no workflow run was ever created for it. Closed.

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.

3 participants