Repository navigation
Run and meter effect programs under the v2 shared-read schedule - #1029
Draft
flyingrobots wants to merge 4 commits into
Draft
flyingrobots wants to merge 4 commits into
flyingrobots wants to merge 4 commits into
Conversation
Kind: new feature (echo#1016, family 1 of 5).
Pure modules that require core.cost.shared-reads/v1 may now use the
checked integer calls (checkedAdd/Sub/Mul/Div/Rem), min and max, and the
Option consumers isSome, unwrap and default. All three judges meter them
at their copying charge, as Amblicit's schedule requires:
- warp-core's shared evaluator holds a checked result's presence inline
(new Shared::Absent/Present) and charges one step per operand cell;
- the lowerer and verifier charge one step per operand cell for the
integer calls, plus operand and result bytes for the Option consumers.
Option constructors, bytes, identity, ordered records, fail and the
effect route remain refused under v2.
The corpus gains `integers`, an Echo program compiled by the pinned
Amblicit at its minimum (5898 steps, 7691 bytes, 181 output bytes). The
producer now reports the compiler's refusal instead of a bare ceiling
miss. Existing minimums are unchanged.
RED (before the change):
cargo test -p warp-core --lib shared_reads_tests
refused at the compiler minimum: UnsupportedProgram (4 failed)
cargo test -p echo-edict-provider-{lowerer,verifier} --lib shared_reads_tests
checked_integers_and_min_max_are_judged_at_the_compiler_minimum
panicked: refused at the compiler minimum
GREEN: warp-core --lib 967 passed; lowerer and verifier all passed;
shared_reads tests 10/10 repeated runs green; corpus --check ok.
Calibration: dropping the Option result bytes from either static rule
fails with "admitted one step less"; overcharging the runtime integer
call fails with "refused at the compiler minimum: StepBudgetExceeded".
Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2
Agent-Tool: Claude Code
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
#340 Kind: deliberate behaviour change (echo#1016; the v2 static rules follow the compiler's corrected schedule). The shared edict.core-cost/v2 corpus is now produced by Amblicit 26a201e7, which adds two rules all three Echo judges now follow: - amblicit#336: a listAppend or listConcat shell is sized by the result's provable length when one exists. The lowerer (`reach`) and verifier (`bounds`) track list-length bounds through locals, record fields, branches, calls and folds, charging a fold round by round until its bounds stop changing, with call costs cached by argument bounds. - amblicit#340: a prelude call that builds a value is charged that value in full. The static judges add it for integer operations and the Option readers; the runtime now charges a word, a checked result with its presence cell and an isSome flag as they are built (cumulative logical allocation), and unwrap/default still share their item. New minimums: reads 22596/63551, fill 9420/87967, nested 24467/220065, integers 5962/11531, rope 1326335/11721939; matches and every output bound are unchanged. The v1 copying goldens are unchanged. RED (bumped corpus, unchanged judges): lowerer and verifier shared_reads_tests: 4 failed each: fill, nested: "refused at the compiler minimum" reads, integers: "admitted one step less" warp-core integer_results_are_charged_as_new_values: unsigned add left: 128 right: 192 GREEN: warp-core --lib 968 passed; lowerer 94 and verifier 96 passed; shared_reads 10/10 repeated runs; corpus --check ok; clippy clean. Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2 Agent-Tool: Claude Code
Kind: new feature (echo#1016, family 2 runtime side).
An effect program whose Core requires core.cost.shared-reads/v1 now
prepares and runs under edict.core-cost/v2 instead of being refused:
- edict_effects/execution/shared.rs runs the same instructions with
shared locals, metering every expression and predicate with the shared
evaluator. Each effect step (atom read, graph read, emission,
obstruction) and the intent's input and output keep their copying
charge exactly; a value crosses into an effect step in canonical form
and a step's result is shared from then on.
- Preparation refuses, before any work, a program with an operation the
schedule has no Echo rule for yet (bytes, identity, Option
constructors, ordered records, fail) in any helper, constraint,
instruction or result.
- The effect route's typing relation and helper decoding admit the
capability (typing is schedule-independent); the read route still
refuses it.
Tests (differential oracle: the same package without the capability):
- edict_effect_package_tests shared_schedule: a read whose require
fails, a node ensure, structured loops, branches and nesting give the
same result, obstruction and mutations; byte operations stay refused;
a repin control proves the refusal is the schedule's.
- public_effect_host_tests: the public graph-read link package, repinned
with the capability and admitted under its own exact policy through
EffectPackageHost, reads and links exactly as the copying package over
six graphs, including all three graph-read obstructions.
RED: before the change every shared package failed to prepare
("package prepares: InvalidPackage"); calibration with the executor
refusing every program fails all six differentials and the graph-read
one ("case 0: output").
GREEN: clippy (all warp-core features, all targets) clean; warp-core
default suite (TMPDIR=/tmp/e1016), the trusted_runtime edict lane and the
pipeline/admission lane all pass.
Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2
Agent-Tool: Claude Code
Kind: deliberate behaviour change (echo#1016, family 2 static side).
The lowerer and verifier no longer refuse an effect program whose Core
requires core.cost.shared-reads/v1; they judge it under edict.core-cost/v2,
as warp-core now runs it:
- every expression and predicate in an effect body (basis, constraints,
let, attempt, loop iterable, branch and require predicates, effect
inputs, the result) is charged its shared-read cost, with list-length
bounds kept for the body's lets (amblicit#336);
- an obstruction payload is charged as a shared record shell plus its
fields' shared work;
- each effect step, the input and the output keep their copying charge,
exactly as the runtime meters them;
- under v2 only, a closure read charges its declared selector, the only
helper the runtime calls, instead of the module's costliest helper
(owner decision); the copying schedule is unchanged.
Tests:
- lowerer and verifier: five shared programs are admitted, byte
operations are refused, and both judges' minimum budgets under each
schedule are pinned and equal (independent oracle: the other judge);
the copying minimums are unchanged.
- warp-core: each program given exactly the lowerer's shared minimum as
its Core budget runs its largest input to the copying result
(runtime never exceeds static).
RED (new tests against the previous sources):
lowerer: read-control left Err(UnsupportedProgram) right Ok(());
"read-control: refused even with an ample budget"
verifier: same two failures
Calibration: one extra allocated byte per runtime expression fails
"ensure-node-control: Err(...AllocationBudgetExceeded) vs Ok"; the
retained v1 corpus verdicts are unchanged.
GREEN: lowerer and verifier suites pass; warp-core effect suites pass;
clippy clean.
Not yet covered: a closure-read effect witness for the declared-selector
rule, and the compiler minimum (blocked on amblicit#341 templates).
Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2
Agent-Tool: Claude Code
Owner
Author
|
Checkpoint at 18e8633. Done:
Remaining, in order:
Interim CI: the component-digest checks fail until promotion. |
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 #1016.
Draft, built family by family (owner-set order). Each family goes RED→GREEN across warp-core, the lowerer and the verifier against a compiler-produced corpus program.
Families
isSome/unwrap/defaultneeded to observe them) — a4c7f5ccontentAddress,contentEdgeId,slotEdgeId,attachmentValueDigest)fail/attemptEffectPackageHost: static bound, runtime charge, elapsed time and peak memory reported separatelyEvidence (family 1)
RED, GREEN and calibration are in the commit message. Existing corpus minimums and the v1 copying goldens are unchanged.
Known interim CI state
The lowerer and verifier sources changed, so the provider-component digest checks will fail until the final promotion.
Documentation
The corpus README and the module docs are updated. Canonical docs and the CHANGELOG come with the promotion.