Repository navigation
dt64/quack: version source-local codes and refuse a stale code space (E2a) - #1982
Merged
Merged
Conversation
A query bound against a source's dictionary kept its literal codes after the dictionary was renumbered. Measured on a swapped dictionary, the frame-1 literal counted 3 rows on frame-2 lanes where the answer is 1. dt64 gains `CodeTable<C>`, the code-space sibling of `MapTable`: for each `CodeSpaceId` (full classid + canonical property) an append-only history of bijections between canonical `ValueKey`s and the source's codes. It is bound to the identity of the FrameStore the lanes are sealed under, and `advance` advances that store exactly once, so a renumbering makes every earlier lane frame non-current. `advance` refuses a foreign store and a non-bijective change set before anything changes. Reads take a `Frame`, never a bare version, and a historical frame reads the mapping in force at its version. quack gains `CodeWitness`, `Draft::bind_typed` and `TypedQuery::admit`. `bind_typed` binds exactly like `bind` and records the owner's witness for every coded field; a coded field without a witness refuses (`Unwitnessed`). `admit` re-checks every witness before the query is handed out and refuses `StaleCodeSpace` otherwise. `Draft::bind` and `Query` are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMMWgnUU9g7Ldyn6sbk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMMWgnUU9g7Ldyn6sbk
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
November 7, 2026 23:44
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Problem
A query bound against a source's dictionary kept its literal codes after the dictionary was renumbered. In the swapped-dictionary oracle, a query bound in generation 1 runs against generation-2 lanes and counts 3 rows. The correct answer is 1.
Change
dt64:
CodeTable<C>. This is the code-space sibling ofMapTable. It tracks the mapping between canonical values and a source's local codes.CodeSpaceId(full u32 classid plus canonical property identity) gets an append-only history of bijections between canonicalValueKeys and the source's local codes.FrameStore. It is bound to the identity of the store the lanes are sealed under.advance. It advances that store exactly once, so a renumbering makes every earlier laneFramenon-current (FrameStore::check). It refuses a foreign store (ForeignStore) and a change set that is not a bijection (Duplicate) before anything changes.keyandcodetake aFrame, never a bare version number. A historical frame reads the mapping in force at its version. That gives the historical meaning of a code, not the historical values of rows.quack:
CodeWitness,Draft::bind_typed,TypedQuery::admit.bind_typedbinds exactly asbinddoes and records the owner's witness for every coded field. A coded field with no witness refuses withUnwitnessed.admitre-checks every witness before it hands out the query, and refuses withStaleCodeSpaceif any has changed.Frame; an owner without a store keeps its own generation.Draft::bindandQueryare as before.BindErrorgains two variants, and nothing in the workspace matches it exhaustively.Not in this PR.
ScaleMismatch) andDomainMismatch: H1.SealedBasis: D.CamLabels, dir-sim, sap): E2b.Validation
cargo +1.99.0 test -p lance-graph-dt64 -p lance-graph-quackon current main (rebased onto dt64: fence MapTable::map_at as diagnose_at returning a non-executable MapDiagnostic #1981): 246 passed, 0 failed.cargo +1.99.0 clippy -p lance-graph-dt64 -p lance-graph-quack --all-targets -- -D warnings: clean.New tests:
tests/dr.rs): frame-keyed historical reads; a foreign frame refused at an equal version; a foreign store refused with nothing changed; a duplicate change set refused with the store not advanced; advancing retires lane frames; an untouched space survives; a frame from before the first generation has no space.admitrefuses, a fresh bind counts 1); a coded field with no witness refuses to bind typed; an unchanged generation admits the sameQueryasbind.Disable runs, each applied on top of the commit, each turning tests red:
admitskips the witness checkadvanceadvancedoes not advance the storeBoard
STATUS_BOARD.mdgains the D-SC section: E1 shipped, E2a in PR, E2b, D and H1.Generated by Claude Code