Oregami
Repositories/oxedyne/ore

oxedyne/ore/oracle

showing oracle/README.md

Ore convergence oracle

Throwaway. Its first job was to decide whether the content-anchored ordering of ore/doc/design/sequence_with_move.md converges, and it has done that; the results are in ore/doc/design/oracle_results.md. Its second was to decide what names a file, which is stage four and ore/doc/design/file_identity.md. Its third is to decide what a cross-file cycle should do, which is stage five and ore/doc/design/cycle_rule.md. Nothing here is meant to reach fe2o3_ore.

In memory only. No log, no serialisation, no files, no persistence, no run-length encoding. Applying an operation is set insertion; the whole of the derived state is recomputed from the operation set on every render, which is what design note section 2.7 licenses and what makes the implementation an obvious transcription of section 4 rather than an optimisation of it.

FileWhat it holds
src/id.rsThe three identifier spaces of section 4.1.
src/op.rsSplice and Move, section 4.6.
src/doc.rsAtoms, slots, the claim register, splitting, anchor resolution, cycle demotion, Fugue ordering, rendering.
src/replica.rsThe frontend: index-based intent to content-anchored operations.
src/cases.rsStage one, the adversarial cases.
src/stage2.rsStage two, randomised convergence over simulated replicas.
src/trace.rsStage three, the automerge-perf trace reader and coarsener.
src/repo.rsThe multi-file engine: three file-identity candidates in one renderer.
src/mrep.rsThe multi-file frontend.
src/mcases.rsStage four, the file-identity cases, predictions written first.
src/mstage.rsStage four, randomised multi-file convergence.
src/cyc.rsStage five, the cross-file cycle cases, predictions written first.
src/csweep.rsStage five, the sweep that plants cycles on purpose.

Two axes are selectable and both matter to the results:

  • Mode -- ClaimRegister (design note section 4.4), SplitBeforeMove (field note section 4.3, arbitrated), SplitBeforeMoveNaive (the same unarbitrated, kept to show that it duplicates).
  • Bind -- LeftBias (the design note as written) or Successor (the repair).

Stage four adds a third axis, Identity, and fixes the other two at ClaimRegister and Successor, those being the only ones the design note now specifies.

  • Derived -- candidate B. No file field on a content operation; each file's creation mints an origin anchor, a one-byte atom born dead, and a file is the subtree beneath one.
  • Recorded -- candidate A. file: FileId on content operations, one Fugue tree per file, one repository-global claim register.
  • RecordedLocal -- candidate A with the per-file claim register fe2o3_ore has today. Kept to measure what the status quo does with a cross-file move.

Stage five adds a fourth axis, CycleRule, meaningful only under Derived, being what the renderer does with a cycle in the anchor graph that runs between two files. Demote is design note section 5.4 unchanged; ConfineVictim, ConfineCycle, LowestEdge and WholeCycle are the four candidates of cycle_rule.md. Predictions for every case were written before the engine could run any of them, in PREDICTIONS_cycle_rule.md.

Running

export CARGO_TARGET_DIR=~/.cache/cargo-targets/ore_oracle_target
cargo test  --release
cargo run   --release --bin stage1
cargo run   --release --bin stage2 200
curl -sLo data/editing-trace.js \
  https://raw.githubusercontent.com/automerge/automerge-perf/master/edit-by-index/editing-trace.js
cargo run   --release --bin stage3 data/editing-trace.js
cargo run   --release --bin stage3 data/editing-trace.js --fine
cargo run   --release --bin stage4
cargo run   --release --bin stage5 400
cargo run   --release --bin stage6
cargo run   --release --bin stage7 100
cargo run   --release --bin stage8 4000

data/ is not committed. The trace is CC-BY from automerge/automerge-perf.

NameSizeWhat
src/201 KiB24 files
tests/11.8 KiB3 files
Cargo.toml260 bytes
PREDICTIONS_cycle_rule.md6.6 KiB
README.md3.9 KiB