The title writes most descriptor records with plain stores (~40k a frame); patching its store sites is an exact alternative to remirroring #43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by 64bitMango on 2026-11-26T11:17:31Z.
From the Wine/D3DMetal ports of the same build (1.0.2.1), relevant to
NativeHost::remirror_tables, which today checks the first 16 entries of each bound table.What the title does in the world. It fills its shader-visible view heap (its frame allocator's memory, image +0x4d9f400) mostly with plain stores and memcpy, not device calls. Measured on the Windows forks: 60k-210k records copied a frame, about 40k a frame that no call announced (fxceless/victory-fork, upstream VIctory PR #305 by Flyander); 400k slots looked at, 40k mirrored a frame (avatarmanz/VIctory-7900XTX
docs/findings.md). Checking only part of each table will miss many of them once the world renders.What worked for them.
Since the native port runs the title in-process with no write watch, (2) looks like the natural fit: exact, and no per-draw checks.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T13:28:31Z.
Thanks for writing this up, @64bitMango.
NativeHost::remirror_tablescurrently only checks a prefix of each bound table, which clearly won't cover ~40k plain-store descriptor writes per frame once world draws ramp up.Since the native host runs in-process without a write watch, patching/hooking the heap store sites (or skipping per-draw tables and tracking only heap-indexed slots) is a very helpful reference when we get to world-scale descriptor mirroring. Added
enhancementandhelp wantedlabels.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T15:56:58Z.
Status: not started. Lower priority than the story-load crash in #15. Still open and up for grabs.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T17:16:13Z.
@Olima34, assigning this to you, since it sits next to the descriptor mirroring and xmem work you've been doing. A first PR that measures it would be enough: which store sites write the ~40k records per frame, and how many patch sites that means. Then we can decide between patching and remirroring.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:10:31Z.
#119 and #127 are merged.
VICTORY_TRACE_DESCRIPTORS=1counts the remirrored records, and=siteslists the title's store sites. Next is a world-load run with=sitesto get the numbers.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T14:50:49Z.
A first
VICTORY_TRACE_DESCRIPTORS=sitesdata point, plus a pointer to a working store-site patch for the same title in another fork.Run: Apple M5 Max, 36 GB, macOS 26.5,
--console series-s, main728845d1plus four open PRs that don't touch descriptors (#335, #341, #342, #358). The run reached the story load and the first world frames (frame ~1600) before my memory guard stopped it at 82 s (other apps were open), so these are world-entry numbers, not steady world.Store sites at frame 1600 (
descriptor store sites since the start, distinct=9, overflow=0):image+0x124a4fimage+0x18849cimage+0x4fb05b8image+0x4d9f059image+0x3a18377image+0x3a1b9c0image+0x4d9f117image+0x4d9f25fimage+0x4e9b4e2descriptor remirrorwent from 2–3 changed records a frame in the menus to 77–84 a frame (about 5,000 of 15,000 checked per 64 frames, all in heap0x20230000) at world entry.A cross-check from another fork: Belobug/VIctory-Belobug-AMD (GPL-3.0, a Windows fork of Marvisak's VIctory) already patches this title's descriptor-table stores (
VICTORY_PORT_DESCRIPTORS=1). Its notes (crates/victory-loader/src/descriptor_sites.rs) say the draws' and dispatches' tables are filled by two functions:+0x4d9efd0for graphics,+0x4eec8e0for compute;and r, 7FE0h/vmovups ymm0, [record]/vmovups [table + r], ymm0);Three of the sites above (
+0x4d9f059,+0x4d9f117,+0x4d9f25f) fall inside the+0x4d9efd0function, so it looks like the same title build. On their RX 7900 XTX the patch replaced a scan of ~600,000 slots a frame and saved 15–16 ms a frame.Before any port, the native host's own cost needs measuring. The remirror here only checks the first entries of bound tables, so its cost isn't the same as theirs. I can do a longer world run with
=sitesonce I have memory headroom, to get steady-world numbers. @Olima34, are you working on the patch side? If not, I'm happy to port Belobug's site patch (with credit) behind a switch and measure it here.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T14:52:31Z.
@derz92 no, we're not on the patch side, so go ahead. Two points before porting:
descriptor_sites.rsembeds the title's original instruction bytes for its byte check. AGENTS.md doesn't allow anything from the game in the repo, so the check would need another form: for example a hash of the expected bytes, or only offsets plus a structural check at run time. Worth confirming that form with the maintainer before you write it.=sitesand the remirror counters over a few hundred world frames) will show whether a store patch saves anything here. Our remirror only checks the first entries of bound tables, which isn't the 600,000-slot scan the 15–16 ms were saved against.GPL-3.0 on both sides, so porting with credit is fine.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by jamal-fv on 2026-11-29T23:15:01Z.
/claim
Resuming on
perf/descriptor-store-sites(wt-storepatch). Mechanism: arm store-hook slot marks (VICTORY_STORE_SITES), not PE jump patches (lift ignores x86). Measuring steady-world sites first (run 2500), then A/B prove.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-29T23:15:14Z.
Claimed by @jamal-fv. Open a draft pull request with
Refs #43in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by jamal-fv on 2026-11-30T00:13:48Z.
Sites measure on aarch64+lift (run 2503,
VICTORY_TRACE_DESCRIPTORS=sites, frame 4096):distinctstayed 0 (run 2500). Withon_watch_fault→ guest function start,distinct=26,overflow=0.+0x4d9efd032.8%,+0x325b4f021.1%,+0x18843017.0%,+0x4d9f20012.2%; Belobug compute fill+0x4eec8e0at 1.4%. Top 4 ≈ 83% of first-faults.VICTORY_STORE_SITES), draft PR #659. Quiet A/B prove queued.