prep: count a request as cached when its stride-table variant is #620

Merged
NickStallman merged 1 commit from upstream-pr/620 into main 2026-12-01 20:32:42 +00:00
NickStallman commented 2026-12-01 12:14:26 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T12:14:26Z.


Two preparations of the same build gave different totals: fresh, 49,469 compiled and 1,193 unsupported; cached, 49,213 cached and 1,452 unsupported. A request refused only for the heap stride is prepared as its variant on the root with the stride table, under the variant's digest, and keeps its refusal markers for the runtime's retry. The first preparation counts it compiled; the next finds only the marker and counts it unsupported.

Of 391 requests marked with the stride reason in that cache, 259 have their variant in the cache and 132 do not, which matches the fresh count.

This keeps the variant's digest beside the markers (<key>.stride) and counts the request as cached when the variant is present and its checksum matches. Runtime lookups are unchanged, and a cache without the note behaves as before, so existing caches keep today's count until those requests are prepared again.

Refs #533.

Tests

  • tests/test_refusal_reasons.py: fresh against cached preparation of a stride-retried request, and the fallbacks (session lookup, malformed note, damaged variant, missing note). Both new tests fail on main.
  • python tuxbox.py check --no-gpu: 13 passed, 0 failed, 0 not run.

Not covered

  • A variant that is also a recorded request of its own is counted once as itself and once for the request it stands for, before and after this change.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5585465210 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/620). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T12:14:26Z. --- Two preparations of the same build gave different totals: fresh, 49,469 compiled and 1,193 unsupported; cached, 49,213 cached and 1,452 unsupported. A request refused only for the heap stride is prepared as its variant on the root with the stride table, under the variant's digest, and keeps its refusal markers for the runtime's retry. The first preparation counts it compiled; the next finds only the marker and counts it unsupported. Of 391 requests marked with the stride reason in that cache, 259 have their variant in the cache and 132 do not, which matches the fresh count. This keeps the variant's digest beside the markers (`<key>.stride`) and counts the request as cached when the variant is present and its checksum matches. Runtime lookups are unchanged, and a cache without the note behaves as before, so existing caches keep today's count until those requests are prepared again. Refs #533. ## Tests - `tests/test_refusal_reasons.py`: fresh against cached preparation of a stride-retried request, and the fallbacks (session lookup, malformed note, damaged variant, missing note). Both new tests fail on main. - `python tuxbox.py check --no-gpu`: 13 passed, 0 failed, 0 not run. ## Not covered - A variant that is also a recorded request of its own is counted once as itself and once for the request it stands for, before and after this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!620
No description provided.