Skip to content

README: note offline theme checks and read-key silencing worker audio - #62

Merged
mparrett merged 2 commits into
mainfrom
readme-worker-notes
Oct 20, 2026
Merged

mparrett merged 2 commits into
mainfrom
readme-worker-notes

Conversation

@mparrett

@mparrett mparrett commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Two README notes from the xsofy audio work (mparrett/xsofy#53):

  • Themes are checked before the music starts. play-theme validates its grids at once, even while the theme waits for music-start, so a game's tests can check its themes with no audio.
  • read-key silences worker-mode audio. Under lg -w, let-go's read-key parks the whole worker with no timeout, so webaudio's render goroutine stops until a key arrives. Filed upstream as lg -w: read-key blocks every goroutine while it waits for a key nooga/let-go#1086. The workaround is to poll term/key-pending? with a sleep. It was checked in headless Chromium on 2026-10-20, on xsofy's message log (xsofy#53 at 83ab040, undertone f1c6c56, seed 976699241). Over 6 s with the log open, peak RMS was 0.2085 polling with a 10 ms sleep (0.2004 on a rerun), and 0.0 with a plain read-key.
    tui: run modal screens on the poll loop instead of blocking reads nooga/xsofy#200 applies the same pattern across xsofy: it moves its nine blocking read-key sites onto a polling run loop. Merged with xsofy#53 and tested 2026-10-20, the message log, help, inventory and quit-confirm screens each kept a peak RMS of 0.18–0.21.

🤖 Generated with Claude Code

mparrett and others added 2 commits October 20, 2026 05:49
play-theme validates a theme before the music starts, so a game's tests
can check its grids with no audio. Under lg -w, read-key parks the whole
worker (nooga/let-go#1086), which stops the renderer; polling
key-pending? with a sleep keeps it running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drum lanes are neither length- nor character-checked, and they run to 32
sixteenths, so "a lane longer than 16 steps" overstated the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mparrett

Copy link
Copy Markdown
Owner Author

Review (medium) addressed at the head commit:

1 and 2. The theme-check note overstated what is checked. Fixed. The README now names what play-theme checks: lead and bass degrees 0..8, lead, bass and pulse lanes of at most 16 steps, and at most three drum lanes. It also says drum strings are not checked: they run to 32 sixteenths, and a character other than X, x or o plays as a rest (drumAt/drumLevel in engine/grid.go and engine/drums.go).

The worker-mode note is unchanged. Its workaround was measured in a browser, as the description says.

@mparrett
mparrett force-pushed the readme-worker-notes branch from a5a83f6 to ff9a4c1 Compare October 20, 2026 14:57
@mparrett
mparrett merged commit 09e6502 into main Oct 20, 2026
4 checks passed
@mparrett
mparrett deleted the readme-worker-notes branch October 20, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant