Repository navigation
lance-graph-dt64-lance: DR's map table made durable through the fire-and-forget cycle writer #1993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,866
−7
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c7ee776
lance-graph-dt64-lance: DR's map table in a separate Lance-versioned …
claude 050fa94
ci: build and test lance-graph-dt64-lance
claude 52dfc8c
wal_shootout: a dr64 mode for DR/DT64 64x64 advances
claude c6fd030
dt64: claim a route version now, apply the advance at it later
claude 0311850
wal-shootout: DR64 sizes measured; DR map advances use LanceCycleWriter
claude d87e448
wip(dt64-lance): rebuild the map log on the fire-and-forget cycle wri…
claude 7e8802b
dt64-lance: map log on the fire-and-forget cycle writer, green
claude d025600
Merge main into the DR map-log branch
claude 542dd6b
board: DR map table entry and D-DT64-7 plan follow the fire-and-forge…
claude 0a89ed9
dt64-lance: replay at the stored genesis; keep a pending advance acro…
claude 8714e17
Merge remote-tracking branch 'origin/main' into ccr-8062bcc7-l7lkz9-d…
claude 36098ae
ci(dt64 map table): also run when the cycle writer, planner sink or L…
claude c2ae0b1
fix(dt64-lance): into_table refuses an undrained log; a refused durab…
claude a2bc41e
fix(dt64-lance): clippy err_expect in the poison test
claude 8ce17af
ci(dt64 map table): check out the sibling ndarray the build path-depe…
claude 4621338
fix(dt64-lance): a seal of unknown outcome blocks the table instead o…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # 2026-11-10 — DR map table made durable through the fire-and-forget cycle writer | ||
|
|
||
| **Status:** VERIFIED-IN-CODE (12 tests; the round trip runs on a real | ||
| `LanceCycleWriter`). Answers the storage half of D-DT64-7 O5 / D10' | ||
| (D-LITHO Q5: "which table"). WAL choice: D-DR64-WAL-1 (EXO-225). | ||
|
|
||
| > ⊘ **SUPERSEDED the same day:** the first version of this crate wrote its | ||
| > own Lance dataset synchronously, compared dataset versions to refuse a | ||
| > stale writer, and reported a post-commit `Race` / `ClockMoved`. That is a | ||
| > custom WAL with arbitration, which the persistence doctrine forbids | ||
| > (`.claude/v3/knowledge/d-mbx-a6-owner-consume-and-persistence.md`). It was | ||
| > rebuilt on the cycle writer. | ||
|
|
||
| **What.** `crates/lance-graph-dt64-lance` (excluded, own workspace) makes | ||
| `dr::MapTable` durable. dt64 stays free of lance and arrow. | ||
|
|
||
| - `MapLog::advance` claims the route version (`MapTable::claim`), turns the | ||
| advance into casts on behalf of the owning mailbox, submits them with | ||
| `CycleWriterHandle::try_submit` (cycle id = route version) and returns at | ||
| once. One background task owns the `LanceCycleWriter`. | ||
| - `MapLog::settle` applies an advance with `MapTable::advance_at` only when | ||
| its seal ticket is `Ok`. A failed seal applies nothing and its version is a | ||
| gap; every later advance is refused (`Poisoned`), matching the writer, | ||
| which seals nothing after a failure. | ||
| - One 512-byte cast per 64 ids: a W64 tile is one cast, a W256 tile four, a | ||
| removal one; each advance adds one marker cast (version, source, | ||
| relation-map revisions). | ||
| - `restore` reads every sealed cycle (`scan_sealed` + `scan_image`) and | ||
| re-applies each advance at its own route version. It refuses a landing on | ||
| behalf of another mailbox and any image that is not a valid log. | ||
| - There is no arbitration: one owner holds the `MapLog`, which owns its | ||
| table mutably. Two writers on one dataset are outside the contract | ||
| (`LanceCycleWriter` fences on its own cached head). | ||
|
|
||
| **Tests.** 4 unit + 8 integration. Disable runs, each restored: | ||
| - applying without a sealed ticket → `a_failed_seal_applies_nothing_and_poisons_what_follows`; | ||
| - no owner check on restore → `every_landing_is_on_behalf_of_the_owner`; | ||
| - applying at the clock's current version instead of the claimed one → 4 tests, | ||
| including `a_clock_tick_between_claim_and_seal_lands_at_the_claimed_version`; | ||
| - no poison gate → the failed-seal test; | ||
| - no reserved-id check → `a_reserved_id_or_a_repeated_tile_is_refused_before_a_version_is_claimed`. | ||
|
|
||
| **Open.** | ||
| - Frames are not restored: a frame is one table instance's witness, so a | ||
| frame from before a restore is `ForeignFrame` (pinned by a test). Issuing a | ||
| frame at a past version after a restore is a DR owner decision. | ||
| - A table whose clock is shared with a `RouteLog` needs the route log | ||
| durable too; only the map is stored here. | ||
| - The map table's compaction schedule (L's files and scan time grow with | ||
| advances; EXO-225). | ||
| - lance-graph does not build without `ndarray-hpc`; this crate enables it. |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| name: dt64 map table in Lance | ||
| # lance-graph-dt64-lance makes dt64's DR map table (dr::MapTable) durable | ||
| # through the supervisor's cycle writer over LanceCycleWriter. | ||
| # It is workspace-excluded (own [workspace] root), so no other job builds it. | ||
| # Without this one a change to dt64's dr module or a lance bump could break it | ||
| # unnoticed. | ||
| # | ||
| # lance's build compiles .proto files: `protoc` alone is not enough, the | ||
| # well-known includes (libprotobuf-dev) are needed too. | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| paths: | ||
| - crates/lance-graph-contract/** | ||
| - crates/lance-graph-dt64/** | ||
| - crates/lance-graph-dt64-lance/** | ||
| # The map log is written through the cycle writer over LanceCycleWriter. | ||
| - crates/lance-graph-supervisor/** | ||
| - crates/lance-graph-planner/** | ||
| - crates/lance-graph/Cargo.toml | ||
| - crates/lance-graph/src/graph/cycle_sink.rs | ||
| - .github/workflows/dt64-map-table-lance.yml | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| CARGO_INCREMENTAL: "0" | ||
| CARGO_PROFILE_DEV_DEBUG: "0" | ||
| CARGO_PROFILE_TEST_DEBUG: "0" | ||
| RUST_BACKTRACE: "1" | ||
|
|
||
| jobs: | ||
| map-table: | ||
| name: DR map table in Lance | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 45 | ||
| defaults: | ||
| run: | ||
| working-directory: lance-graph | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| path: lance-graph | ||
| persist-credentials: false | ||
| # lance-graph's ndarray-hpc feature and the planner path-depend on | ||
| # ../../../ndarray. | ||
| - name: Checkout AdaWorldAPI/ndarray (sibling dependency) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: AdaWorldAPI/ndarray | ||
| path: ndarray | ||
| persist-credentials: false | ||
| - name: Install protoc and the protobuf includes (for lance) | ||
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libprotobuf-dev | ||
| - name: Setup rust toolchain (pinned by rust-toolchain.toml) | ||
| run: rustup show | ||
| # See dir-sim-persist.yml: spell target-cpu=native out as this runner's | ||
| # feature list so the cache never reuses an artifact on another CPU. | ||
| - name: Resolve target-cpu=native for this runner | ||
| id: cpu | ||
| run: | | ||
| flags=$(.github/scripts/resolve-native-rustflags.sh) | ||
| echo "RUSTFLAGS=$flags" >> "$GITHUB_ENV" | ||
| hash=$(printf %s "$flags" | sha256sum | cut -c1-16) | ||
| echo "flags=$hash" >> "$GITHUB_OUTPUT" | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| key: cpu-${{ steps.cpu.outputs.flags }} | ||
| workspaces: lance-graph/crates/lance-graph-dt64-lance | ||
| - name: fmt | ||
| run: cargo fmt --manifest-path crates/lance-graph-dt64-lance/Cargo.toml --check | ||
| - name: clippy | ||
| run: cargo clippy --manifest-path crates/lance-graph-dt64-lance/Cargo.toml --all-targets -- -D warnings | ||
| - name: test | ||
| run: cargo test --manifest-path crates/lance-graph-dt64-lance/Cargo.toml | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # lance-graph-dt64-lance — DR's versioned global -> local table (dt64 | ||
| # `dr::MapTable`) stored as a separate Lance-versioned dataset | ||
| # (D-DT64-7 O5 / D10', D-LITHO Q5). EXCLUDED from the lance-graph workspace | ||
| # (own [workspace] root), like lance-graph-dir-sim-lance: dt64 stays free of | ||
| # lance and arrow. | ||
| # | ||
| # Advances are fire and forget: each one is a cycle submitted to the | ||
| # supervisor's CycleWriter, whose single background task owns a | ||
| # LanceCycleWriter (D-DR64-WAL-1). The advance is applied to the table only | ||
| # after its seal ticket resolves Ok; a failed seal is a gap. | ||
| # | ||
| # Build/verify: | ||
| # cargo test --manifest-path crates/lance-graph-dt64-lance/Cargo.toml | ||
|
|
||
| [package] | ||
| name = "lance-graph-dt64-lance" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| publish = false | ||
| license = "Apache-2.0" | ||
| description = "DR's versioned global -> local map table made durable through the fire-and-forget cycle writer, replayed exactly at restore." | ||
|
|
||
| [workspace] | ||
|
|
||
| [dependencies] | ||
| lance-graph-dt64 = { path = "../lance-graph-dt64" } | ||
| lance-graph-contract = { path = "../lance-graph-contract" } | ||
| lance-graph-planner = { path = "../lance-graph-planner" } | ||
| lance-graph-supervisor = { path = "../lance-graph-supervisor", features = ["cycle-driver"] } | ||
| # LanceCycleWriter, the WAL (graph::cycle_sink, behind `planner`). `ndarray-hpc` | ||
| # is required: lance-graph does not build without it (its fallback is stale). | ||
| lance-graph = { path = "../lance-graph", default-features = false, features = ["planner", "ndarray-hpc"] } | ||
|
|
||
| [dev-dependencies] | ||
| tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "time"] } | ||
| tempfile = "3" |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.