Commit Graph
145 Commits
Author SHA1 Message Date
CuteBootyandClaude Fable 5.2 e31f474068 feat(hle): skip the title's Bink movies on request (VICTORY_SKIP_BINK, off by default)
VICTORY_SKIP_BINK=1 skips the movies that play once (logos, the intro);
=all skips the looping ones too. Unset, nothing changes: no import is
rebound. The title's own Bink DLL still opens each movie; the exports a
player loop calls on an open movie (BinkWait, BinkDoFrame*, BinkNextFrame,
BinkGoto, BinkShouldSkip, BinkClose) are bound to wrappers that put a
skipped movie on its last frame, so the title's own end-of-movie check ends
it at once.

Wiring for this tree (run.rs): SkipMovies wraps WithTitleDlls at startup,
so the executable's and its DLLs' imports go through it, with the
FidelityFX Interpose on top (it only looks at its own DLL and is unchanged);
and it wraps the resolver LateDlls binds DLLs the title loads later with.

Original author: C-GDev (fxceless/victory-fork pull request 613, 75fe122c;
the idea is from XCL pull request #1053, the code was written anew for
VIctory's loader). Ported by hand from CuteBooty/victory-8gb.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-27 00:56:49 -07:00
Blitzball996 025abd3dc8 Input: PS5 pads (DualSense, DualSense Edge) read from HID, over USB or Bluetooth
XInput is read first; HID pads take the slots XInput leaves free (VICTORY_DUALSENSE: 0 off, 1 both, unset auto). dualsense.rs is taken unchanged; Host reads XInput in xinput() and keeps the HID owner of each slot; victory-hle gets Win32_Devices_DeviceAndDriverInstallation and Win32_Devices_HumanInterfaceDevice. The mouse capture (#17) and F1 menu paths are unchanged.

Source: LooperSalty/AnyXboxX third_party/victory crates/victory-hle/src/modules/gameinput/dualsense.rs
2026-11-27 14:43:53 +08:00
trustno1-coderandClaude Opus 5.5 06afe633e6 Window and input from #17: asked for, off by default, in the F1 menu
Fullscreen, the English keyboard and the mouse capture now run only when
asked for (VICTORY_FULLSCREEN=1, VICTORY_MOUSE_CAPTURE=1,
VICTORY_IME_ENGLISH=1), so a start that sets nothing keeps the window and
input as before. The F1 menu has the three of them (FULLSCREEN (NO BORDER),
MOUSE CAPTURE, ENGLISH KEYBOARD); a change applies at the next start.

Checked: victory-hle, victory and the menu tests, with the three unset and
with all three set to 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:53:38 -08:00
superboynick 4a0c8ea373 Window and input: fullscreen, English input method, and a mouse capture that leaves the pointer alone
Three switches, each on by default, each 0 restoring the behaviour before it: VICTORY_FULLSCREEN (borderless, VICTORY_FULLSCREEN_RES for another size), VICTORY_IME_ENGLISH (the window's input context to en-US), and VICTORY_MOUSE_CAPTURE (clip to the client area and hide the pointer, release on focus loss).

Capture also fixes a mistake in the mouse device merged as #9: it warped the pointer back to the centre after every sample, which pins the absolute position the title reads and makes the camera look frozen. Warping is now VICTORY_MOUSE_WARP, off by default; with it on the delta is taken from the centre.

Measured on an RTX 5070 Ti Laptop (12 GB): window 0,0-1920,1080 with a client area of the same size and GetClipCursor returning it. cargo build --release and --profile diag pass, cargo test -p victory-hle: 162 passed, 2 ignored.

Written with an AI assistant.
2026-11-27 12:12:12 +08:00
trustno1-coderandClaude Fable 5.2 22c6be2e76 F1 settings menu, frame generation 2x-6x live, no frame rate cap, FPS line
On readmet3xt-lab/foxhound 02fc18a, which becomes this fork's base.

- host/menu.rs: the F1 settings menu, in every build (it was in the
  diagnostics build only): DLSS mode and model, frame generation, frame
  rate cap, console profile, picture size, the light estimates and the
  main speed switches. Saved to victory-settings.txt, applied by the
  launcher at the next start; "save and restart" from the menu. The title
  gets no keyboard while it is shown (gameinput.rs).
- host/font.rs: the dot letters, moved out of the diagnostics panel so
  that the menu has them in every build.
- streamline.rs: VICTORY_FRAMEGEN_X=2..6, the frames shown for each one
  rendered (no more than the state says this card generates); 0: ready
  but off. The amount and off/on change while the title runs
  (set_framegen, from the menu). Result 39, "warning: out of VRAM", is
  taken as set: asked again at every present it showed no generated
  frame at all (1,828 times in one run on a full 12 GB card).
- The frame rate at the top left of the picture while the menu is closed:
  frames rendered a second, and with frame generation those shown
  (VICTORY_FPS_LINE=0: not). The window's caption says both too.
- scripts/play-foxhound.ps1: applies what the menu saved; -FrameGenX;
  -Fps defaults to 1000 (no cap: VICTORY_FRAME_INTERVAL_US=1000); frame
  generation is made ready at every start with Streamline so that the
  menu can switch it (-NoFrameGenReady: not), with a share of the card's
  memory held back for it (VICTORY_TEXTURE_ROOM_PERCENT 80 on, 86 ready);
  NVIDIA's files are looked for in nvidia-sdk\ here; builds the layer when
  it is not built. scripts/play-nvidia.ps1 is the same launcher under
  this fork's old name.
- Get-NVIDIA-DLSS.cmd / scripts/get-nvidia-sdks.ps1: fetch the eight
  NVIDIA files that are loaded (about 70 MB) out of NVIDIA's Streamline
  release into nvidia-sdk\ (git-ignored). They are NVIDIA's, under
  NVIDIA's licences, and are not part of this repository.
- README for this fork; foxhound's own is kept as docs/README-foxhound.md.

Measured on an RTX 5070 (Series X, native 2560x1440, DLSS Quality,
opening rooms): mostly 26-30 frames a second rendered; in Streamline's
own check 2x, 4x and 6x show exactly 2, 4 and 6 frames for each one
rendered.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 19:41:59 -08:00
local 376f9832d6 Renderer port 1: know the 32-bit heap by the kind the title really asks with
Run port1-2: nothing was arranged and the heap was still scattered. The
title reserves it with kind 0x42000 (reserve, 0x40000), without the
64 KiB page bits, so it was not taken for a placeholder and was never
recorded. Any 32-bit reservation without commit is recorded now; the
test reserves the way the title does. A warning says once why pages
mapped there are left where they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9c23e8dd40cac6fb4a2aa8c804587e7c2e2a5853)
2026-11-27 02:08:02 +05:30
local 35c57d666e Renderer port 1: the 32-bit heap's pages get their section's slices in address order
Run port1-1: the title maps the five pieces of its 185 MB heap in another
order than their addresses, so the heap was views of one section in a
scattered order ("not one stretch of a section: Scattered") and nothing
was placed. With VICTORY_PORT_CONSTANTS=1 xmem now gives the page numbers
mapped into a 32-bit graphics reservation the slices at their offset in
it, when the reservation is all one section and both slices are fresh
(never mapped or written: no commit bit), which the title cannot observe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4b82f6c259d7a693e0e30eaaafc4c5a54b77d9e8)
2026-11-27 02:07:51 +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
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 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 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 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 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 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 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
readmet3xt-labandClaude Opus 5.5 9cb55c71fe Page-mapping copies: count them once, measure runs, map runs in one view (switch)
The streaming log's copies of page mappings (CopyPageMappingsBatchX ->
map_aliases) were counted twice with one mapping thread: once for the
batch and once more for each range in it (map_alias), so their calls and
milliseconds (254,000 calls, 70.3 s in run x1440-streamlog) were up to
twice what they were. A batch is now one call; map_alias called alone
still counts.

The log's M line has two more fields at its end: pages the copies mapped,
and how many of them show the section page after the one the page before
them shows, i.e. what one view could show with it.

VICTORY_MAP_RUNS=1 (off by default) maps such a run through one view: 2
system calls where a view a page took 2n (unmapping is the dearest call,
about 110 us a view in a cutscene). A run gets one view where its
addresses are one placeholder: the hole one view left, holes of views of
ours side by side that cover it exactly (joined into one with
MEM_COALESCE_PLACEHOLDERS), or memory with no hole of ours in it (cut out
of the title's reservation; if that fails, nothing is changed). Anything
else goes a page at a time, as before. A copy whose source is mapped onto
itself is looked up page by page as it changes, as before, and the pages
before a source page that is not mapped are mapped all the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 19:11:27 +05:30
readmet3xt-labandClaude Fable 5.2 2f0fbe147a Frame interval and refresh overrides, live key input for test drives
VICTORY_FRAME_INTERVAL_US paces frames at another interval than the
title asks (it asks 33.333 ms); VICTORY_DISPLAY_REFRESH adds a refresh
rate above 60 Hz to the display mode list. VICTORY_KEYS_FILE lets a
driver script press the stand-in pad's buttons while the title runs.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 14:57:18 +05:30
codec_d 3bcc96f9bb Port NVIDIA Wave32 lowering, smooth movie-plane uploads, XMA audio fixes, and 32GB RAM residency budgets 2026-11-25 15:31:19 -08:00
codec_d f5847e6248 Merge VIctory-7900XTX (0a43566) with RTX 5090 fidelity & 32 GB RAM optimizations: two-plane compose, fallback heaps, TablePlan, residency guard, 256 MiB DirectStorage, and WaitOnAddress fence wakes 2026-11-25 14:43:52 -08:00
localandClaude Opus 5.5 af3c946271 Merge local/next into day/shaders; pipeline workers are all woken
Queue: passes over the screen first (local/next), then what draws asked
for, the early ones, and those known to take long by a quarter of the
workers. start() woke one worker, which could be one of the two that take
passes over the screen alone: the pipeline then waited for the next push.
All are woken now. victory warm goes through the pipelines no run drew with
in no order, 40 a process. victory translate: VICTORY_HOST_RDNA=1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 15:32:48 -06:00
local 3321b7e346 Merge day/textures 2026-11-25 13:44:40 -06:00
localandClaude Opus 5.5 2f22f6e2c2 The title's pipelines written down (VICTORY_PIPELINE_BOOK=1, off) and made ahead of a run, each batch in a process of its own (victory warm)
Every pipeline the title creates goes to known-pipelines.bin beside the
pipeline library, its containers to known-shaders.bin (in the cache folder;
they are the title's code). `victory warm` makes their host pipelines in
idle-priority processes of 200 each and lets them go: the driver's cache on
disk keeps them. Those earlier runs drew with come first; what is done is
noted by translator and driver (warm-done.txt); a pipeline that ends or
hangs its process is named in warm-bad.txt and skipped. VICTORY_EARLY_ALL
does this in the running title and ended it inside the driver.

Not measured yet: how long, and how much the driver's cache grows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 13:32:18 -06:00
localandClaude Opus 5.5 fe20cd8dbd VICTORY_MAP_THREADS=auto is asked for, not the default: 16 threads map no more pages than one in the dorm, and a frame takes longer
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 13:31:25 -06:00
local 53ab99577f Merge day/faults 2026-11-25 12:55:59 -06:00
local f6e2b31ceb Merge day/textures 2026-11-25 12:55:58 -06:00
localandClaude Opus 5.5 44c69a8fee The title's writes into guarded blocks go in beside the guard: its memcpy, memmove and memset (VICTORY_COPY_BESIDE=1) and single stores that fault (VICTORY_STORE_BESIDE=1); both off
Most of what faults is the runtime's memcpy (a third by time) and single
stores into objects that lie in memory some copy covers: flags, reference
counts, links of free lists. The bytes are put in through our own view of the
page, the block told as written at every view by a bit that the next asking
takes: no protection changes, for the write or for the next taking.

Copies: the title's imports are ours and look at the blocks' bits. Stores:
the instruction that faulted is decoded and done in the handler. Too many to
a block, or code that fills blocks: opened as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 12:41:23 -06:00
localandClaude Opus 5.5 bc478bb832 Two measurements for placing memory: bytes over the bus by host copy, and what the title asks its memory to be
Diagnostics: per copy what goes up and what is fetched (every five seconds, the eight that
move most), and the protections title memory is asked for with (write-combined and GPU bits).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 12:40:10 -06:00
localandClaude Opus 5.5 5108036010 Pages are mapped by sixteen threads while the title streams as fast as they are mapped, by the caller alone otherwise (VICTORY_MAP_THREADS=auto, which it is unless set)
The title's streaming thread spends 400 to 750 ms of a second in mapping calls
in the world's first minute (runs stream-1 to -4; DirectStorage itself answers
in 1 to 8 ms): each call waits a millisecond or two in the host's queue behind
the guards' protection changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 11:40:12 -06:00
localandClaude Opus 5.5 29be4bfd47 A list makes a view its tables hold once and copies its descriptor (VICTORY_LIST_VIEWS=0: for every table); a draw's tables are gone through without memory of the heap
The recording job the frame waits for last (24 of 65 ms, timeline waits-2) is
2,500 indirect dispatches, each with a table of its own that differs in a
constant buffer. VICTORY_AB can turn VICTORY_MAP_THREADS (8 or 1) too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 09:03:29 -06:00
local 7c62f5b707 A timeline of a few frames, with the chain each present came out of (VICTORY_TIMELINE)
Diagnostics only. VICTORY_TIMELINE=<file> records three frames (or
VICTORY_TIMELINE_FRAMES) after VICTORY_TIMELINE_AT seconds and writes a
Chrome trace and a text summary: spans of our work, the waits and wake-ups
of the title's threads (its imports) and of ours (our import table), long
kernel calls on the address space, and when each submission ran on the card.
The summary walks back from each present through who waited on whom.
Nothing is wrapped without the variable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 008de5f9ffcef132079b1af8b7f4f1c22235cee9)
2026-11-25 07:46:13 -06:00
localandClaude Opus 5.5 2acfdfb380 Scripted keys can be held from one time to another
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 07:19:34 -06:00
localandClaude Opus 5.5 0ca4cda3ea A texture is not copied onto itself; the process opts out of the efficiency mode (victory-fork a2537066)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 06:19:18 -06:00
local 57a8ff2214 Merge branch 'night/stream' into local/next 2026-11-25 04:44:19 -06:00
localandClaude Opus 5.5 4c53da0a52 Pages are mapped side by side: eight threads stand in the host's queue instead of one
Mapping and unmapping a view wait for what every protection change of a
view takes too (about 100,000 a second, the guards'): 0.2-4 ms a page, all
on the one thread the title loads with. Scatter maps and the GPU's
page-mapping copies go in groups of up to 64 pages, noted before and after
on the caller's thread, the system calls on up to eight
(VICTORY_MAP_THREADS=1: one after the other, as before).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:31:31 -06:00
localandClaude Opus 5.5 0aa2ab952b The title's idle and lowest threads run below normal: loading no longer waits for idle processors
VICTORY_TITLE_PRIORITIES=0: as the title sets them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 04:31:31 -06:00
localandClaude Opus 5.5 6b643cf775 Merge night/cpu: a sampling profiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:23:59 -06:00
localandClaude Opus 5.5 5b3e97f713 The process runs above normal priority, pipeline workers below the title's loading
VICTORY_PROCESS_PRIORITY=normal and VICTORY_PIPELINE_LOWEST=0 for the old
ways.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:06:38 -06:00
localandClaude Opus 5.5 0c46a8cfe0 Streaming: mapping calls ask only for what they need; the thread that loads runs ahead; a streaming log
All of the title's loading goes through one thread of its own, which maps
the pages of a batch and then submits it. Each page took up to four system
calls (unmap, split, map, commit), each waiting for the address-space lock:
200-400 us a page in the world. No split of a placeholder that is the
view's own, no commit of section pages that are committed
(VICTORY_MAP_LEAN=0: as before); the thread, below normal priority as the
title sets it, is lifted above it where it maps (VICTORY_STREAM_PRIORITY=0:
not). VICTORY_DSTORAGE_LOG=<file>: every request, status entry and the cost
of the mapping calls; VICTORY_STACKS names each thread's affinity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 03:06:38 -06:00
localandClaude Opus 5.5 baf947a380 Diagnostics: a sampling profiler (VICTORY_PROFILE=<from>,<to>,<ms>,<file>[;...])
Samples the 28 busiest threads, whole stacks, with what the frame is at.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 02:58:07 -06:00
local 5fae8ea1d8 Revert "HLE: show title windows through a stand-in that always reads its messages"
This reverts commit 9820bdc45e.
2026-11-25 01:14:23 -06:00
AnoHunted adb608af1f Audio: an XMA write block past the ring's end wraps before the first write
The write block (context word 0, bits 27-31) was used as it is for the first
block of a pass, so one at or past the ring size (bits 22-26) was written
past the ring's end, possibly into another APU allocation, before it wrapped
with (write + 1) % size. Take it modulo the ring first, as the read block is
taken, and as advance_read does.

(cherry picked from commit 7a5d85e6a2867081ed54515ce7f33bae3fcb643d)
2026-11-25 01:08:05 -06:00
quaternion 01708dd7ba fix(hle): keep apostrophes intact when splitting relaunch args
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).

(cherry picked from commit eb8067f2eae84cb64081af357cd03a48944a42b2)
2026-11-25 01:08:05 -06:00
moe-miau 0618f88ebe XGameSave: a stray or unreadable version folder never costs the save
Recovery took any name `v<digits>` as a version, so a leftover `v01`
next to a committed `v1` parsed as version 1, and the cleanup rebuilt
the name as `v1` and deleted the committed save (#870). A correctly
named but unreadable newer entry (an empty `v2`, a file, a broken
manifest) did the same: `v1` was pruned as older, the read failed, and
the next update committed a fresh `v1` holding only the changed blobs,
which the following read pruned again.

Now only `v<N>` exactly as `commit` writes it is a version. `current`
takes the newest version whose manifest reads, removes only versions
below it, and leaves unreadable newer entries alone. An update goes
above the highest version name present, so a stray entry neither hides
the save nor blocks writes. With no readable version at all, reads and
updates still fail and nothing is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b8dbcba260d1012dca8f06ee572e5244bffba1ac)
2026-11-25 01:03:03 -06:00
Vax 088d3c4924 HLE: show title windows through a stand-in that always reads its messages
A title makes its window on one of its own threads and reads its messages
only when that thread reaches its PeekMessage loop. In slow frames and
loads that is seconds apart, so the system shows the busy cursor over the
window and a click turns it into a "Not responding" ghost.

A top-level title window is now made message-only (it can never be shown),
and a stand-in window with the title's text, style, icon and fitted size is
made on a thread of ours that does nothing but pump its messages. The
title's ShowWindow shows the stand-in, its window text follows, closing the
stand-in suspends and ends the title as before, the keyboard window menu is
still refused, and the stand-in goes when the title's window does. Frames
are presented to the process's visible window, now the stand-in; input is
unaffected, since titles read it through GameInput, not window messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9145d9d3dabb0d5f8263b4203a82586710929d90)
2026-11-25 01:03:03 -06:00
imjustprism 80979cba9a flush a kept save blob that had to be copied
(cherry picked from commit eb7cc2d43711e806bbd8578d4ef75bde30326c20)
2026-11-25 01:03:03 -06:00
Calvix2k e9b4302e8f HLE: guard dialog commands before initialization
(cherry picked from commit 9ccb83c00a9b0ee5121e4a9b2f6c0ee223630c84)
2026-11-25 01:03:02 -06:00
fluffyflattershy-afk 8af324dc02 HLE: allow an explicit maximum title window size
(cherry picked from commit a7636dd7b1a4a76eaa4f1cf211d2ff31faacc3f5)
2026-11-25 01:03:02 -06:00