Repository navigation
test(core): use a buffered descriptor for direct IO comparison - #9
Merged
bertholomus merged 1 commit intoOct 12, 2026
Conversation
5 of 8 tasks
Owner
|
Thank you @sayyidfareed — merged. ELI5: the test's "buffered" reference was still opened for direct I/O — flipping the in-process flag doesn't clear O_DIRECT — so one unaligned byte failed the read and the comparison lied. Opening a genuinely buffered descriptor fixes it; nothing else changes (test-only). Verified here: |
bertholomus
added a commit
that referenced
this pull request
Oct 20, 2026
…ything new (tp2 #18) --loop-guard watched only for an exact cycle of at most eight tokens. A templated reasoning loop, each line fresh while its token 8-grams recycle, has no such cycle: @Capicua25x saw the guard fire 0 times on 6 such runaways in production traffic (tp2 #18). The guard now also counts, in windows of 1,024 reply tokens while the think block is open, the share of the window's token 8-grams (with the 7 tokens before it) that no earlier window had; that many windows in a row under 2% close the think block the way a cycle does. This is our Python engine's call_gate.ThinkLoop (the novelty signal of tp2 #9, on token ids), next to cycleAt, which stays the first check. - TENSORFOLD_LOOP_WINDOWS: the dry windows in a row (default 10; 0: exact cycles only). Python's 3 cut a legitimate long deliberation in @Capicua25x's traffic; 10 still caught every runaway they captured. - runtime.loop.novelty: the closing window's share of new grams; the server log says loop=novelty:0.0000. - Without --loop-guard nothing changes. With it, a reply with an exact cycle closes as before and reports runtime.loop.period; only a reply the cycle check misses can close earlier. - loopCut finds the window end in a round's tokens, so drafted rounds close where single tokens do. As in ThinkLoop.cut, only a batch's first window end may fire (rounds are far shorter than a window). Tests: each window's share equals the Python reference's (a loop of 13, and a three-letter LCG text over 60 windows); the fire points equal the reference's on four sequences at 3 and 10 windows, a token at a time and in rounds of 7 and 48; a loop of 13 closes thinking through the lane engine, drafted equal to plain. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit 94725fbbf0cb834343e6e6f5f23307a7f4f37bfb)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
The buffered reference was opened with File.open (O_DIRECT) and then plain.direct was set false. That flag does not clear O_DIRECT on the fd; raw pread of one unaligned byte returns -1. Open the reference explicitly O_RDONLY|O_CLOEXEC, check it opened, and close it normally. All original byte comparisons and BufferTooSmall assertions remain. No production code, read alignment, or serving behavior changes.
Receipt
4e80f05ecba89a4e90d16375ade2eddbdc0a10c4, Zig 0.17.0, Ubuntu 24.04.5 LTS, kernel 7.0.0-1019-nvidia, NVIDIA driver 580.178.04; Linux ARM64 CUDA environment; two NVIDIA GB10 nodes for historical live tests, SM121, Mia EXL3 2.9 bpw revision64ba41b6c916a587db06eae2e19b7845f7be6e6b, recipe v0.6.1 kit. Container ARM64 imagesha256:1ad8c1382c09861dee9c342b59f6e5e3e65fe7fde4a07b5e379bc985b66902dd.4e665c646a28b8c93903f93ebe6a934d6f61b157; commandzig build test -j1 --summary allwith a shared Zig cache.zig fmt --checkpasses changed Zig files.test-goldenwas attempted on the pinned source but that step does not exist, despite CONTRIBUTING.md naming it.Checklist
Merge considerations
Two-way revert; no live/runtime effect.