test(docs): anchors from the functions behind design.md's rules to their docs, and a check they resolve #25
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!25
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/doc-anchors"
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?
Why
The functions that keep design.md's hard-won rules (cross-queue waits, captures instead of live guest memory, passes split for clears and hazards) don't say so where they are defined, so an agent reading one sees a wait or a capture that looks redundant and may "simplify" it away. This puts a one-line pointer to the written rule above each, and a check that the pointers stay valid.
What changed
renderer:
// doc: docs/design.md#4-the-lessons-from-mkw-as-rules-hereanchors above the functions behinddocs/design.md§4's rules. Comments only; no code changes:submit_jobingpu/vk/vk_replay.cpp(cross-queue event waits);gpu/vk/vk_memory.cpp(theRX_VK_CAPTURE_POOL_MBcomment above them: nothing the replay reads comes from live guest memory);register_texture_queuedingpu/vk/vk_replay.cpp(registrations in order with the submits);NOP_REPORT_COUNTER's timestamp scaling inreplay(),gpu/vk/vk_replay.cpp(GPU timestamps drive dynamic resolution);clear_after_drawsanddraw_hazardsingpu/vk/vk_draw.cpp(a clear after draws, and a draw that samples what its pass wrote, get a pass of their own).build:
rss_mbinnx2/build.pypoints todocs/compiler-memory-accounting.md.tests: new
tests/test_doc_anchors.py(standard library):doc:anchor in our code (host/,gpu/,nx2/,scripts/,builder/; not eden, sirit or third_party) names a file underdocs/and, after#, one of its headings, by GitHub's anchor rule (slug(),anchors_of(): a repeated heading gets-1);REQUIRED).A renamed heading or a deleted anchor fails with the file and line.
Flags and settings
None
Measurements
main:
000f19fb(2026-11-13)this PR: feat/doc-anchors @ 7691d857
Hardware: Ryzen 9 3900X, 64 GB, Windows 11 (RTX 3080; no game run: these are game-free checks)
Scene: none: game-free. The anchors from the rules' functions to their docs, checked
Method:
tests/test_doc_anchors.pytwice on this branch; then in a scratch copy of the tree, once each with a fault it must catch: the anchor aboverss_mbdeleted, a required anchor changed to#4-lessons, and a new anchor inhost/hos_main.ctodocs/design.md#4-lessons, a heading that is not there. main has neither the anchors nor the checkHow to reproduce:
python -I -B tests/test_doc_anchors.py; then make one of the faults and run it again000f19fbRebased since onto main
0c74253d: its four commits since000f19fbare #177 (a log line's level, in the renderer's logging), #192, #193 and #194 (the README, the website, the Discord status), none in the runner or the checks measured here; #177's lines invk_draw.cppandvk_memory.cppare not the ones the anchors sit above, and the check passes on the rebased branch, so the numbers hold.Testing
Tested: the runs above;
tests/run_all.py, the whole suite, on this branch and on main0c74253d, Windows (483 passed and 6 failed on main, 484 passed and 6 failed here, no failure main doesn't have: test_check_third_party, test_display_pointer, test_fpx_sticky, test_release, test_spawn_emit and test_texture_staging_publication fail on main too (the last since #177; #202 fixes it)). The seven lines added ingpu/vk/vk_draw.cpp,vk_memory.cpp,vk_replay.cppandnx2/build.pyare comments, none after a line that continues (a backslash), so both platforms' compilers see the code main has.Not tested: in the game (comments only, nothing runs differently); on Linux (the check is plain Python).
Needs other testers: None
Screenshots
Nothing on screen.
Risk and rollback
Nothing runs differently: the source changes are comments. The new check can fail a later PR that renames a heading in
docs/design.mdordocs/compiler-memory-accounting.md, or reshapes one of the seven functions so its marker moves; the message names the file and line. Reverting the commit is enough.Reviewer notes
Carried over from https://github.com/NotRexed/Hookshot/pull/2942 with the move to Longshot: the same change on Longshot's
main, with its rename applied. Its review and discussion are there.The dev-loop proposal's F2 (https://github.com/NotRexed/Hookshot/pull/2636). Other functions can take anchors in later PRs, as their docs are written; the check covers every new one.
The checks were run on the GitHub version; this branch is the same change with the rename applied (the same files and line counts). Forgejo runs no checks, and they were not run again here. Only the checks that read the changed files were run, not the whole
run_all.py.Issues
See https://github.com/NotRexed/Hookshot/pull/2636 (F2).
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.mainand passing here.🤖 Generated with Claude Code
test(docs): anchors from the functions behind design.md's rules to their docs, and a check they resolveto WIP: test(docs): anchors from the functions behind design.md's rules to their docs, and a check they resolveBack to WIP under #48's process: this was carried over before the new template. Its description will be brought to the template and measured on Longshot (main against this PR, at named commits) when it's wanted for review; ask here if you'd like it sooner.
Description brought to Longshot's PR template (#48). Still WIP: its numbers are from the GitHub version, and it isn't rebased on current main; it gets measured on Longshot (main against this PR, at named commits) before it is marked ready.
Description moved to the template's Testing section and whole checklist (#72): what was tested, what wasn't, and what needs other testers (their test requests to open while this is WIP).
The description follows the template after #76 and #106: If applicable keeps only the boxes that apply (one that applies and isn't done yet stays unticked while this is WIP), the Flags table has the template's seven columns (Goal is now Recommendation), and GitHub references are full URLs. Nothing else changed.
Rebased onto main
0c74253dand measured on Longshot: the 7 anchors resolve (twice), and the check fails on all three faults it should catch (an anchor deleted, a required one changed, a stray anchor to a missing heading). Whole suite on this head and on main: no failure main doesn't have. Ready for review.84be88a6d3de6e89ef34WIP: test(docs): anchors from the functions behind design.md's rules to their docs, and a check they resolveto test(docs): anchors from the functions behind design.md's rules to their docs, and a check they resolveproci referenced this pull request2026-11-14 00:01:43 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.