Repository navigation
Conversation
Backport ashhart/TensorFold e9ba70f and allocation-safety follow-up 0ce409c, retaining original authorship and detector bytes. Adapt the pinned TP2 stream lifecycle and expose default-off LOOP_GUARD with offline launcher coverage.
otherview
marked this pull request as ready for review
November 12, 2026 16:25
This was referenced Nov 13, 2026
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.
Description and motivation
A reasoning passage longer than eight tokens can repeat until the reply budget
is exhausted on this recipe's pinned TP2 engine. Backport TensorFold's indexed
long-loop detector and allocation-safety follow-up; preserve original authorship
and byte-identical detector code. Adapt only the older stream lifecycle.
Expose opt-in
LOOP_GUARD=1(default off) to pass--loop-guard. A hit closesreasoning and continues the same reply. Reasoning history, compaction and
thinking budgets are unchanged. This mitigates verbatim loops; it does not fix
the checkpoint or guarantee correct continuation.
Refs ashhart/TensorFold#1075 and its later allocation-safety follow-up. No new
PR is proposed against TensorFold main, which already has this detector.
Testing
c7f2b851/ enginefbbc971after all 53 patches; no dependency on zig/patches/0063: Preserve long cached prefixes when a separate continuation copy cannot fit #115, zig/patches/0061: the call gate's first token is the drawn token (#80) #118 or the cache-protection PR.
zig build -j2 test --summary all: 23/23 steps succeed(cached successful targets reused on non-root rerun).
reasoning-history policy checks; bash syntax checks pass.
and 12/18 agent results, with identical coding samples. These quality profiles
disable thinking, so they are serving controls, not recovery correctness proof.
(periods 168, 181, 1285), with identical outputs versus prior guarded production
and distinct proposed actions. Tool results were simulated and reasoning was
retained. Separate deterministic workflows completed 252 valid actions per
phase with no duplicates; the same count-31 instead of 32 report error remained.
docs/long-loop-guard.mdseparates this PR's host checks from prior combined-imageGPU evidence and states remaining limits. The patch intentionally changes
output after a detected loop; unaffected native token equivalence on this exact
standalone branch is still pending.
Checklist
Submitted for maintainer review with the live checks above still outstanding;
no standalone GPU qualification is claimed. Production was not interrupted for
this preparation. No private conversation capture is published.