View memory guarded beside the submission's asking #109
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!109
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-109"
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?
@mgrein on GitHub · 2026-11-30 13:06 UTC · original
mgrein:guard-first→main· +0 −0 · 0 files · 48 commits · closed without mergingFollow-up to #80 (batched guards). With
VICTORY_ASK_FIRST=1, the submission's write-watch asking starts on its own thread (victory-ask), next to the submitting thread's planning.guard_aheadthen ran on the submitting thread after that asking had been waited for. In the world of a new retail game that guarding cost 11 % of the submitting thread (~4.8 ms a frame), almost all of itVirtualProtectcalls incover()on other views of written blocks.This moves the guarding next to the asking. The asking job hands the guarding to a
widehelper (shadow::wide_run) and does its own asking meanwhile. The asking only touches write-watched memory andguard_aheadkeeps only view memory, so neither holds the other's pages (Askings). The submitting thread still callsguard_aheadat the old spot and finds the ranges published. A block written in between isn't published and gets guarded by its own refresh, which is howguard_aheadalready behaves.VICTORY_GUARD_FIRST=0guards after the wait, as before.VICTORY_GUARD_FIRST=abswitches every 20 seconds and logs each switch (guard-first switch <unix ms> on|off), for an A/B inside one run.Measured
RTX 4070, Ryzen 5 5600X, Series S profile, DLSS quality + frame generation,
VICTORY_SUBMIT_SPLIT=1,VICTORY_ASK_FIRST=1,VICTORY_OFF_LINE=1. Each test is a 10-minute idle run in the world with=ab, pairing neighbouring 20 s windows.The gain is smaller than the guarding's cost. The kernel probably serializes part of
GetWriteWatchandVirtualProtectunder the process's address-space lock. A first version guarded after the asking on the asking thread and gained nothing (12 of 26 pairs), because the planning beside it is shorter than the asking.cargo test -p victory-gpu --libpasses.🤖 Generated with Claude Code
@mgrein on GitHub · 2026-11-30 15:27 UTC · original
A second, longer run (15 minutes, 41 pairs of neighbouring 20 s windows, same settings): frame median −0.3 ms, faster in 27 of 41 pairs. Together with the first run that's 45 of 67 pairs, so the gain is real but small, about 0.3–0.5 ms a frame.
An A/A run since then (a switch that changes nothing, toggled the same way) showed the frame-median pairing is unbiased (13 of 25), but the 5-second submitting-thread metric is too noisy to pair on (−3.6 ms with nothing changed). Please read the "submitting thread" row in the table above as indicative only.
@readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original
A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection.
Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.
Pull request closed