dstorage: reads into physical pages wait for the title's Submit (DSTORAGE-HOLD-PAGE-READS) #2124
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2124
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2124"
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?
@QemmHD on GitHub · 2026-11-25 21:35 UTC · original
ubiquitarianism:claude/dstorage-hold-page-reads→main· +456 −12 · 4 files · 1 commits · merged 2026-11-26 14:41 UTCA queue with auto-submit on submits itself once the entries enqueued since the last submit reach half its capacity (
enqueue()→submit_locked()). A request into physical pages names its pages throughDestinationPageArray, which the worker reads only when the request runs (publish()→page_transfer()). The title fills that page table just before it calls Submit. So a read started by the self-submit finds page 0 (the entry fails with E_INVALIDARG) or the page number the slot held before (the data lands in a page that now belongs to something else, with no error).LEONIDA_DSTORAGE_HOLD_MSbounds a hold (2000 ms by default, 0 for no limit), so a path that never calls Submit cannot stall for good.LEONIDA_DSTORAGE_HOLD_PAGES=0restores the old behaviour.[rt] ds-holdcounts self-submits, held reads, full-queue and timed releases, and page lists that were still empty when read.Tests (Windows 11, RTX 4070 SUPER, VS 2022, Ninja)
dstorage_testwith the newtest_page_reads_wait_for_submit: 551 checks pass. WithLEONIDA_DSTORAGE_HOLD_PAGES=0, 15 of them fail: the read lands in the page the list named before, and an empty list fails.test_runtime_pathsworkflow check fails, as on main.Idea from fxceless/victory-fork 79cfdd9 (after Marvisak/VIctory eddde73), written anew for this queue.
AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
@qhukz13 on GitHub · 2026-11-26 00:25 UTC · original
Review at
6b09de493(code reading plus a native Windows run ofdstorage_test, see the end). The hold keeps queue order (everything behind a held read waits with it), a full queue releases it because the title cannot call Submit from inside an enqueue,Closesubmits everything, and the worker only times a hold while it has nothing submitted to run. Reads right to me.One question before it is on by default: the hold changes behaviour for any title path that enqueues a read into physical pages, then a status/fence/event entry, and waits on that entry without calling Submit, counting on the self-submit at half capacity. Today that path runs; with the hold it waits
LEONIDA_DSTORAGE_HOLD_MS(2 s) per occurrence and then goes with the page list as it is. The synthetic test cannot say whether the title does that. Your own[rt] ds-holdline answers it:timed_releasesandfull_releasesfrom one retail boot past the story load (andpage0_entrieswith the hold off, to see how often the early read actually hit an unfilled list). Iftimed_releasesis 0 there, the 2 s default is safe; if not, those stalls would show up as missed frames at the world start.Native Windows 10 run (the description has Windows 11): GTX 1050 Ti host, Windows 10 Pro 19045, MSVC RelWithDebInfo, this head merged onto main
61732aca1(clean).dstoragepasses 3/3, plain and withLEONIDA_VK_VALIDATION=1. WithLEONIDA_DSTORAGE_HOLD_PAGES=0it fails 3/3:dstorage: 551 checks, 16 failureshere (the description says 15 for that mode, so one more on this machine), with0x89240007/0x8924000fentry failures, so the new test does tell the two modes apart.AI-assisted (Claude Code).
@QemmHD on GitHub · 2026-11-26 00:39 UTC · original
Thanks for the review and the Windows 10 / GTX 1050 Ti run.
On the question: I have data from real boots. Our test build has carried this same hold (same code,
LEONIDA_DSTORAGE_HOLD_MS=2000default) for the last ~10 boots on an RTX 4070 SUPER, and several of them got past the end of the main load to the start of the world. In none of them did a[rt] ds-holdline appear. That line is printed the first time any of its counters moves, and the self-submit counter moves on every half-capacity self-submit, even one that holds nothing. So in those boots no queue ever self-submitted at half capacity: zero holds, sotimed_releasesandfull_releaseswere 0, and the case you describe (waiting on an entry without Submit, relying on the self-submit) didn't come up. The title we test seems to call Submit itself well before half capacity, or creates its queues with auto-submit off. I'll add a one-time line per queue (capacity, auto-submit on/off) so this is visible directly instead of inferred from a missing line.Your point stands for other titles, though. If you or the maintainers prefer, I can make the timed release default to 0 ms (no hold time, only the full-queue release), or ship the hold off by default behind
LEONIDA_DSTORAGE_HOLD_PAGES=1until there is data from more titles. Happy to do either.On 16 vs 15 failures with the hold off: that mode is only there to show the test tells the two modes apart; the count isn't asserted. Which reads the worker reaches before the test rewrites the page list depends on thread timing, so a one-check difference between machines is expected.
AI-assisted (Claude Code, Claude Opus 5.5).
@aslan2142 on GitHub · 2026-11-26 14:42 UTC · original
Thank you, @QemmHD. This went into
mainthrough #2350 (RT-LINUX-AMD-WORLD), merged at your head6b09de493with your commits and authorship kept. GitHub shows this PR as merged for that reason, so nothing needs closing.AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)