Skip to content

1.0 - #782

Open
pug205gti6 wants to merge 11 commits into
fxceless:mainfrom
pug205gti6:main
Open

1.0#782
pug205gti6 wants to merge 11 commits into
fxceless:mainfrom
pug205gti6:main

Conversation

@pug205gti6

Copy link
Copy Markdown

No description provided.

@marquezinii

Copy link
Copy Markdown
Contributor

I looked through this and I think it needs splitting before it can be reviewed properly.

Most of the diff is formatting. I ran cargo fmt --all on this PR's base (8dd30ab), and 51 of the 59 changed files came out byte-identical to the PR. The real changes are in 8 files of victory-gpu. The reformat of the rest touches code nearly every other open PR edits, and the branch already conflicts with main (a26859f) in 4 files.

What I found in those 8 files:

  • #[allow(...)] on placed_filler_twins, depth_written and the sort_by in draw.rs. These are the three clippy errors that keep main's CI red, so fixing them would help every PR. Removing the dead code, or using sort_unstable_by_key, would fix them rather than hide them.
  • texture.rs: has_detiled/detiled_levels, so that an on-demand texture's level mask is not used before its first detile, plus a test. This looks right to me. Levels on demand are still off by default.
  • inplace.rs / watch.rs: views of a page are opened again when the page's view count crosses MANY_VIEWS, and views_gone now returns what to re-guard.
  • descriptor/host.rs: tracking of slots backed by tiled textures (tiled_shown, first_shown), with two tests.
  • host.rs / watch.rs: a diagnostics line for the time the remap lock is held. Textures no longer wait for remappings of other title memory #95 adds a similar counter.

The PR has no description, its title is "1.0", and CI hasn't run. My suggestion: drop the formatting, rebase on main, and open the pieces above as separate PRs, each saying what it fixes and how it was checked (the lint fixes alone would be quick to merge).

naixue2233 and others added 9 commits November 25, 2026 15:35
…k in one call

Two costs of the paths a26859f added, on a 3840x2160 window with a 2522 to
4394 draw world frame (RTX 3080, Windows 10, release build). 9376fd6 already
took the third (the fingerprint), so that is not here.

1. sync_heaps walked the 1,024 to 2,048 records of every page the kernel
   called written: 300,000 to 485,000 records a frame, of which 12,000 to
   20,000 were new. The kernel marks a page written even when the title put
   back the bytes it already held, so most of that walk found nothing. The
   page's bytes are now compared with the ones last read (64 KiB, a few
   microseconds) and the page's records are skipped when they are the same.

2. copy_back_with wrote every run of changed bytes through the kernel on its
   own: 53 to 75 MB a frame in runs a handful of bytes long, at 3 to 4
   ms/MB. The runs of one copy are contiguous, so they and the gaps between
   them (the title's bytes as read, so putting them back writes what is
   already there) now go back in one write per copy.

Measured, same scene band (2400 to 3200 draws/frame), medians of the frame
lines, before and after:

| | before | after |
| --- | --- | --- |
| frame | 815 ms | 364 ms |
| preparing, copies | 123 ms / 191 MB | 71 ms / 194 MB |
| copying back | 216 ms / 64 MB | 210 ms / 62 MB |

The first change is what moved the frame; the copies fell with it (fewer
slots left stale, so less to refresh). The second did not move the copying
back figure on its own — the one-write form lands in the same 210 to 256 ms
band, so the time there is not the write call itself. It is here because it
is fewer syscalls over the same bytes, not because I can show a win from it,
and it can be dropped without touching the first.

Honest limits: the run drifts through the prologue, so the bands are medians
of 2 to 4 frame lines at matching draw counts rather than a fixed camera, and
the later runs had a warm shader cache.

Two things the fork needs on Windows 10 to run at all, not part of this PR:
the app-local Agility SDK runtime (without it the title dies at +0xb5a5f8 on
the in-box runtime) and the keyboard stand-in pad fix from upstream fxceless#729
(with an XInput keyboard such as a Wooting the title otherwise gets no input).
…E_TEXTURES=1)

While the world streams in, a submission checks hundreds of textures one
after another on the submitting thread: each is read, hashed whole and,
when it changed, detiled into its staging buffer. With the switch the
checks that come due in a batch are queued (Batch::textures_due) and run
at its next flush, before a step that writes title memory and before the
lists run, so their order against those steps is unchanged, on the
threads kept for the snapshots (shadow::wide_run). Each check reads its
texture's title memory and writes its own staging buffer and notes under
its own lock, and a texture is queued once per batch (texture_due), so no
two threads check the same texture. The frame line's "textures" counts
the time it took, not the threads' sum.

Measured on the opening cutscene and the first world minutes (RTX 3090
Ti, 8dd30ab, same binary, one launch each):

  default                        frame ~1,030 ms, textures ~330 ms
  VICTORY_WIDE_TEXTURES=1         frame   ~826 ms, textures ~120 ms
  VICTORY_TEXTURE_NO_WAIT=1       frame   ~654 ms, textures  ~44 ms
  both                           frame   ~518 ms, textures  ~16 ms

Steady state after streaming: 4.0-4.3 fps in all four.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rHNfuPpCyeMjHxWTEyhiQ
… a page and a cheap fingerprint

sync_heaps looked at about 180,000 slots a frame in the world, and for each took the heap's fingerprint lock and hashed its 32-byte record with BLAKE3: 35.6 ms a frame on an i5-12400F (its own counter), the frame about 20 ms longer than with VICTORY_HEAP_SYNC=0.

The slots of a page are now compared under one lock, and the fingerprint is four multiply steps (each a bijection of the state, so records one word apart never share one). What is mirrored, and when, is unchanged.
…S=1, or VICTORY_PROBE_PIPELINES)

With residents on, every bound slot was checked against its view's copy
(HostHeap::shows takes the heap's lock, once per view of every draw), and
every view set the +R/+W/+S tag bits, in every build and run. These are
measuring tools; they now run only with VICTORY_DRAW_PROBES=1 or when
VICTORY_PROBE_PIPELINES names pipelines. Off, the residents' line counts
no mismatched slots (0).
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.

5 participants