Oregami
Repositories/oxedyne/ore

oxedyne/ore/oracle/README.md

3.9 KiB, 1 run

created by r2848102244:51, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1# Ore convergence oracle
2
3Throwaway. Its first job was to decide whether the content-anchored ordering of
4`ore/doc/design/sequence_with_move.md` converges, and it has done that; the
5results are in `ore/doc/design/oracle_results.md`. Its second was to decide what
6names a file, which is stage four and `ore/doc/design/file_identity.md`. Its
7third is to decide what a cross-file cycle should do, which is stage five and
8`ore/doc/design/cycle_rule.md`. Nothing here is meant to reach `fe2o3_ore`.
9
10In memory only. No log, no serialisation, no files, no persistence, no run-length
11encoding. Applying an operation is set insertion; the whole of
12the derived state is recomputed from the operation set on every render, which is
13what design note section 2.7 licenses and what makes the implementation an
14obvious transcription of section 4 rather than an optimisation of it.
15
16| File | What it holds |
17|---|---|
18| `src/id.rs` | The three identifier spaces of section 4.1. |
19| `src/op.rs` | `Splice` and `Move`, section 4.6. |
20| `src/doc.rs` | Atoms, slots, the claim register, splitting, anchor resolution, cycle demotion, Fugue ordering, rendering. |
21| `src/replica.rs` | The frontend: index-based intent to content-anchored operations. |
22| `src/cases.rs` | Stage one, the adversarial cases. |
23| `src/stage2.rs` | Stage two, randomised convergence over simulated replicas. |
24| `src/trace.rs` | Stage three, the `automerge-perf` trace reader and coarsener. |
25| `src/repo.rs` | The multi-file engine: three file-identity candidates in one renderer. |
26| `src/mrep.rs` | The multi-file frontend. |
27| `src/mcases.rs` | Stage four, the file-identity cases, predictions written first. |
28| `src/mstage.rs` | Stage four, randomised multi-file convergence. |
29| `src/cyc.rs` | Stage five, the cross-file cycle cases, predictions written first. |
30| `src/csweep.rs` | Stage five, the sweep that plants cycles on purpose. |
31
32Two axes are selectable and both matter to the results:
33
34- `Mode` -- `ClaimRegister` (design note section 4.4), `SplitBeforeMove` (field
35 note section 4.3, arbitrated), `SplitBeforeMoveNaive` (the same unarbitrated,
36 kept to show that it duplicates).
37- `Bind` -- `LeftBias` (the design note as written) or `Successor` (the repair).
38
39Stage four adds a third axis, `Identity`, and fixes the other two at
40`ClaimRegister` and `Successor`, those being the only ones the design note now
41specifies.
42
43- `Derived` -- candidate B. No file field on a content operation; each file's
44 creation mints an origin anchor, a one-byte atom born dead, and a file is the
45 subtree beneath one.
46- `Recorded` -- candidate A. `file: FileId` on content operations, one Fugue
47 tree per file, one repository-global claim register.
48- `RecordedLocal` -- candidate A with the per-file claim register `fe2o3_ore`
49 has today. Kept to measure what the status quo does with a cross-file move.
50
51Stage five adds a fourth axis, `CycleRule`, meaningful only under `Derived`,
52being what the renderer does with a cycle in the anchor graph that runs between
53two files. `Demote` is design note section 5.4 unchanged; `ConfineVictim`,
54`ConfineCycle`, `LowestEdge` and `WholeCycle` are the four candidates of
55`cycle_rule.md`. Predictions for every case were written before the engine could
56run any of them, in `PREDICTIONS_cycle_rule.md`.
57
58## Running
59
60```
61export CARGO_TARGET_DIR=~/.cache/cargo-targets/ore_oracle_target
62cargo test --release
63cargo run --release --bin stage1
64cargo run --release --bin stage2 200
65curl -sLo data/editing-trace.js \
66 https://raw.githubusercontent.com/automerge/automerge-perf/master/edit-by-index/editing-trace.js
67cargo run --release --bin stage3 data/editing-trace.js
68cargo run --release --bin stage3 data/editing-trace.js --fine
69cargo run --release --bin stage4
70cargo run --release --bin stage5 400
71cargo run --release --bin stage6
72cargo run --release --bin stage7 100
73cargo run --release --bin stage8 4000
74```
75
76`data/` is not committed. The trace is CC-BY from `automerge/automerge-perf`.