Repository navigation
fix(runtime): reset run bounds at their seams (AC2) - #278
Merged
Merged
Conversation
The context reservation re-bases in the in-run marker's transaction, streamed model text is bounded per window, empty-output cap raises are per streak, and in-run compactions no longer spend the between-run 32-step fold budget. The in-run cutoff is the stored ordinal of the last replaced turn, so a faulted attempt or reactive overflow inside the replaced span no longer shifts replay off the live splice. Slice AC2 (ENG-1017); closes ENG-991.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…mpaction Review on #278: the ledger check was a debug assertion, so a release mismatch would panic on the index or compact against the wrong turn. It now fails the run as a server fault. Also documents the zero-row re-base of an already settled prompt run and the per-streak retry allowance. Slice AC2 (ENG-1017).
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.
Spec / tracking
ENG-1017, autonomous-core AC2, ADR-0048 § 1. Closes ENG-991.
Change
A long run's harness bounds now reset at their seams instead of building up over the run's lifetime:
InRunCompactionRequestcarries the retained weight. A crash leaves either the old marker with the old reservation, or the new marker with the new one.WindowScope::model_text_bytes) and zeroed at each in-run compaction. The error message now says "per-window".TurnScope::empty_output_retries). Any completed turn restores the allowance.MAX_COMPACTION_STEPS(32). The between-run fold keeps that budget. An in-run step still has to shrink the context and is charged to the caller's limits.RunScope::live_turns), not a count of live assistant messages. A faulted attempt inside the replaced span no longer makes replay keep a turn the live run summarized. Adebug_assertchecks that every live assistant message has its ordinal.No protocol, store schema or prompt change.
docs/design/architecture.mdis amended.Verification
Each new test fails on main (
13d9c585), or under the old cutoff rule for ENG-991:separated_empty_truncations_each_recover_with_a_fresh_retry(AC2 c);scripted_soak_completes_across_context_windows(a; main stopped at 399/500 on the 4 MiB limit);forty_in_run_compactions_complete_off_the_between_run_budget(d; main stopped at 32);forty_mib_of_streamed_text_across_windows_completes(b).an_empty_faulted_attempt_inside_the_replaced_span_keeps_replay_equal_to_live(ENG-991): replay equals the live request, andassert_assembly_matches_referencepasses.the_between_run_fold_still_stops_at_its_step_budget.one_run_spanning_several_windows…now also assertscontext_compaction_attempted = 0and a re-based reservation below the run's lifetime result bytes.Gates:
cargo fmt --all -- --check;-D warnings;cargo test -p qq-core --lib: 915 passed;cargo test --workspace --exclude qq-core: 1,291 passed;cargo build --workspace;git diff --check.Performance
On the hot path, this adds one
Vec<u32>push per settled turn and moves two counters.turn_overheadwas not re-measured for this slice. The AC1 qualification receipt (dispatch +4.0% vs A/A +0.14%) is in the ledger and still open with the lead.Review
docs/plans/workflow.md§ 4 requires an independent review because this touchessessions/and the run loop.