Repository navigation
docs(history): add a host example and Criterion benchmarks - #986
Draft
Lef Ioannidis (elefthei) wants to merge 5 commits into
Draft
Lef Ioannidis (elefthei) wants to merge 5 commits into
Lef Ioannidis (elefthei) wants to merge 5 commits into
Conversation
Step mode suspends after every Continue. handle_instruction_suspend advanced the top frame's pc whenever frame.pc <= self.pc, so after CallRule pushed a callee laid out before its caller, the callee frame's entry pc was bumped past RuleInit and the rule body ran from the wrong instruction. Only an explicit InstructionOutcome::Suspend now advances the frame pc; the Continue arm already did, and a pushed callee frame owns its pc. - tests/rvm/vm/suites/call_rule.yaml: call_rule_callee_laid_out_before_caller
…n unimplemented) - Added the history-syntax and junco-core crates (rule syntax, portable flat sources, flattening, validation); LimitError moved into junco-core and is re-exported at its old path. - With feature `history`, the RVM compiler lowers history.require/forbid to one row of Program::history_tables[0] plus one HistoryStep; executing it fails with the fatal HistoryUnimplemented (HistoryFeatureDisabled without the feature). - Program format version 7 is additive: HistoryStep is the last Instruction variant and history data lives in a trailing binary section, so version-6 blobs still decode completely. - CI runs the history tests and the std,arc,history feature subset; docs cover the syntax, HistoryStep and the v7 layout.
…ator - Add the history-store crate: interned identities and committed histories with revisions. - Add junco-core lower_flat and the runtime reference evaluator (depth 256, 65536 nodes). - RegoVM::attach_history/set_history_input; HistoryStep pins a revision at its first dispatch, folds at most batch_size events per dispatch and repeats at the same PC. - Replace HistoryUnimplemented with typed fatal history errors; recheck the revision on resume and completion. - load_program always cancels a suspended execution. - Port the history_table suite; CI tests history-store.
Lef Ioannidis (elefthei)
force-pushed
the
upstream/history-4-examples-benches
branch
from
November 21, 2026 04:52
550ac4c to
10df62e
Compare
- Add history-semantics (normalization, symbolic derivatives, cursor-batched RuleRuntime) and run it from HistoryStep. - history-store gains hash-consed graphs (hashconsius 0.1.4, bumpus 0.1.2), bounded caches and the typed Store<E>/History<E> views. - Restore the Verus specs and proofs; verus.yml verifies the default, history and no-default history,arc,std configurations. - Keep the reference evaluator as a test-util oracle; the exhaustive word test checks it against the regex oracle and the RVM. - Balance generated alternations in history_tables tests under the parser's expression depth limit.
- examples/history: compile a require/forbid policy, append events to a shared HistoryStore and print three decisions. - benches/history_table: warm, append-one and invalidated-replay decisions over 16/256/4096 events. - ci-release runs the example; docs/builtins.md links it and describes the benchmarks.
Lef Ioannidis (elefthei)
force-pushed
the
upstream/history-4-examples-benches
branch
from
November 21, 2026 05:32
10df62e to
83f6ab4
Compare
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.
examples/history/main.rscompiles a release policy with two rules.history.requireallows a release only if that principal edited the same resource.history.forbidblocks the release if anyone removed the resource. The example interns the paths in anArc<HistoryStore>, appends the events and attaches the store to aRegoVM.cargo run --example history --features historyprints:The root manifest declares the example with
required-features = ["history"].cargo xtask ci-releaseruns it throughrun_example.cargo bench --features history --bench history_tableruns the Criterion benchmarks inbenches/history_table.rsat batch size 256 on histories of 16, 256 and 4,096 events. The policy[any, {principal == p, action == "edit", resource == r}, any]can accept after one matching edit.star({action == "edit"})has to check every event in these all-edit histories.For each policy, the benchmarks time a decision on an unchanged warm prefix, after appending one event to a retained prefix, and after truncation forces a replay from the root. Truncation invalidates the prefix cursor; the graph and successor caches stay warm during replay. Setup, interning and request staging happen before timing. The cases that modify history use
iter_batchedto keep truncation and appends outside the timer too.docs/builtins.mdlinks to the example from "Native boundary" and describes the cases under "Benchmarks".Stacked on #985, after #982, #983 and #984. Review the last commit; it changes no library code.