Repository navigation
Charge v2 allocation for values built by prelude calls - #340
Conversation
Under the shared-read schedule every Call node was charged one step and no allocation, and byte, text, integer and Option operations added steps only. So core.bytes.concat, core.bytes.slice and the Option operations built values for zero charged bytes, contradicting the README and maxAllocatedBytes as cumulative logical allocation (#328). A prelude call without a shared-read rule is now charged its result's full size, as under v1. Source and native Target share the meter. The reference evaluator gains byte values, concat, slice, length and the Option constructors. RED: the evaluator metered 13,333 bytes against a 4,309-byte v2 minimum, and eight extra rounds added only 3,088 / 2,600 bytes. GREEN: 4/4; existing schedule tests sound; cargo xtask verify exit 0. Flat ReplaceRange (jedit#410 @ 67a85dc): 261,523,656 -> 261,826,990 steps, 175,260,814 -> 213,473,665 bytes; Target lowers at the new minimum. Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2 Agent-Tool: Claude Code
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Plain-English Walkthrough
TL;DR
Under the shared-read (v2) cost schedule, values built by prelude calls (byte concat and slice, text concat, integer and
Optionoperations) were charged no allocated bytes. That made the static bound unsound against the definition ofmaxAllocatedBytesas cumulative logical allocation [claim:unsound, confidence:1.00]. They are now charged their result's full size, as the documentation already stated. Jedit's flat ReplaceRange minimum rises from 175.3 MB to 213.5 MB (203.6 MiB) [claim:rope, confidence:0.95].Walkthrough
Bug. In
fold_work/shared_reads.rs,shared_owncharged everyCallone step. The call rule then added only copying-schedule steps for typed prelude operations, never bytes.Fix. A prelude call without a shared-read rule is now charged
value(result).evaluation(), its cells plus one step and its full bytes, as under v1. List operations keep their shell rules, andlistAtstill returns a shared reference. The source checker and native Target use this same meter, so their minimums stay equal. echo#1016 must mirror the rule.Verification.
cargo xtask verifyexits 0.Flat ReplaceRange (jedit#410 at
67a85dc): 261,523,656 → 261,826,990 steps and 175,260,814 → 213,473,665 bytes. Target lowers at the new minimum; the build then stops at the provider, as before.The docs are agent-written and not yet human-reviewed.
Appendix: Citations
claim:unsoundbuilt_byte_and_option_values_stay_within_budgetRED on main;crates/amblicit-syntax/src/target_ir/fold_work/shared_reads.rs@4ffc7c68claim:ropeCloses #339