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 | |
| 3 | Throwaway. 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 |
| 5 | results are in `ore/doc/design/oracle_results.md`. Its second was to decide what |
| 6 | names a file, which is stage four and `ore/doc/design/file_identity.md`. Its |
| 7 | third 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 | |
| 10 | In memory only. No log, no serialisation, no files, no persistence, no run-length |
| 11 | encoding. Applying an operation is set insertion; the whole of |
| 12 | the derived state is recomputed from the operation set on every render, which is |
| 13 | what design note section 2.7 licenses and what makes the implementation an |
| 14 | obvious 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 | |
| 32 | Two 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 | |
| 39 | Stage 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 |
| 41 | specifies. |
| 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 | |
| 51 | Stage five adds a fourth axis, `CycleRule`, meaningful only under `Derived`, |
| 52 | being what the renderer does with a cycle in the anchor graph that runs between |
| 53 | two 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 |
| 56 | run any of them, in `PREDICTIONS_cycle_rule.md`. |
| 57 | |
| 58 | ## Running |
| 59 | |
| 60 | ``` |
| 61 | export CARGO_TARGET_DIR=~/.cache/cargo-targets/ore_oracle_target |
| 62 | cargo test --release |
| 63 | cargo run --release --bin stage1 |
| 64 | cargo run --release --bin stage2 200 |
| 65 | curl -sLo data/editing-trace.js \ |
| 66 | https://raw.githubusercontent.com/automerge/automerge-perf/master/edit-by-index/editing-trace.js |
| 67 | cargo run --release --bin stage3 data/editing-trace.js |
| 68 | cargo run --release --bin stage3 data/editing-trace.js --fine |
| 69 | cargo run --release --bin stage4 |
| 70 | cargo run --release --bin stage5 400 |
| 71 | cargo run --release --bin stage6 |
| 72 | cargo run --release --bin stage7 100 |
| 73 | cargo run --release --bin stage8 4000 |
| 74 | ``` |
| 75 | |
| 76 | `data/` is not committed. The trace is CC-BY from `automerge/automerge-perf`. |