fix(builder): dev site-hooks keeps a caller's mark when a hook is entered again, so test_title_card_sites passes #2594
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
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
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2594
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/site-hooks-reentrant-mark"
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?
Summary
tests/test_title_card_sites.py, new in #2589, fails on main (Assertion draws==3 failed), so every PR's game-free checks part 1/2 fails.The cause is in the test harness, not the game.
longshot-builder dev site-hookswraps each hook site so a C test can run it. A wrapper tells the hook's paths apart by one thread-local mark: it sets the mark to 0, calls the hooked function, then reads it.ui.titleDraw's callback draws the title card's three strips by calling the same function again, whose own wrapper then reset the mark under its caller. The outer hook read the inner call's answer and took itself for not handled, so the fixture's game draw ran a fourth time, with the picture already clobbered.Each wrapper now saves the mark before its call and puts it back after. The lift itself lowers a hook to control flow, not to a mark, which is why the game drew the card correctly in #2589's run.
Read
builder/crates/longshot-builder/src/dev/site_hooks.rs,wrapper.Testing
Tested: Linux (CachyOS), through the job queue:
tests/test_title_card_sites.pyfails on main: the fixture counts 4 draws (strips 2, 3, 4, then the whole picture again). It passes here.tests/sitehooks.pypass (run_all.py --strictwith those names), so the other sites' answers are unchanged.Still to test: None.
Measurements
Nothing to measure: the test harness only.
Risks
None for players:
dev site-hooksonly builds test fixtures. Revert to undo.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (the 47 checks this touches; CI runs the rest)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec