Repository navigation
opt(t27os): G3+G4 preallocated ring — optimization #3 (Closes #12779) - #13102
Merged
Merged
Conversation
Replace the 64-entry stack arrays in pty_fold/graph_fold_ring with preallocated 256-entry ring buffers (pty_ring_kinds/pty_ring_pids, graph_ring_kinds/graph_ring_pids) reused on every call. No stack array is allocated and no per-call clear happens; batch fold (#1) and k-hop cache (#2) are untouched. Tests: G3 7/7, G4 9/9 (new preallocated-ring tests on both specs); t27b --check clean on both specs (0 JIT/interpreter mismatches); seals saved and MATCH. Refs #12988 — gap "land the Queen band tap ring from lane/queen-band-graph". phi^2 + phi^-2 = 3 | TRINITY
gHashTag
enabled auto-merge (squash)
November 2, 2026 10:30
Contributor
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.
Closes #12779.
Optimization #3: preallocated ring buffers replace the 64-entry stack arrays
in pty_fold/graph_fold_ring (G3/G4). 256-entry ring buffers
(pty_ring_kinds/pty_ring_pids, graph_ring_kinds/graph_ring_pids) are reused
on every call — no stack array allocated, no per-call clear. Batch fold (#1)
and k-hop cache (#2) are untouched.
Tests on the merged tree: G3 7/7, G4 9/9 (new preallocated-ring tests); t27b
--check clean on both specs (0 JIT/interpreter mismatches); seals saved and
MATCH. All local gates pass.
Refs #12988 — gap "land the Queen band tap ring from lane/queen-band-graph".
phi^2 + phi^-2 = 3 | TRINITY