From 91b3d5412ef24cb07fced81fb8369c0c97e94682 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 21:17:59 +0000 Subject: [PATCH 1/4] lance-graph-r2il: production alias views for the polyfill lens (D-DT64-7 L4) Each POLYFILL word now records which alias is its SQL and which its Quack name (sql_at, quack_at index into the existing aliases, so no name is spelled twice). FrozenWord gains name_of, name_in and is_alias. PolyfillView is a ClassView answering 0xFFFF with one label per position in R2IL, SQL or Quack; the predicate IRI names the word, the label the language. WithPolyfill puts it over a consumer's view, answering 0xFFFF and delegating every other concept. The binding path and the 0xC401 reading are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF --- crates/lance-graph-r2il/src/polyfill.rs | 215 +++++++++++++-- .../tests/integration/main.rs | 1 + .../tests/integration/polyfill_views.rs | 252 ++++++++++++++++++ 3 files changed, 451 insertions(+), 17 deletions(-) create mode 100644 crates/lance-graph-r2il/tests/integration/polyfill_views.rs diff --git a/crates/lance-graph-r2il/src/polyfill.rs b/crates/lance-graph-r2il/src/polyfill.rs index 21751e2a7..52a835b37 100644 --- a/crates/lance-graph-r2il/src/polyfill.rs +++ b/crates/lance-graph-r2il/src/polyfill.rs @@ -21,7 +21,9 @@ //! order. The opcode, arity and R2IL name of each entry are checked against //! OGAR's `R2ILVocabulary` by test, not at run time. +use lance_graph_contract::class_view::{ClassId, ClassView}; use lance_graph_contract::ogar_codebook::compose_classid; +use lance_graph_contract::ontology::{DisplayTemplate, FieldRef}; use ogar_loco::FnIndex; use ogar_r2il::{ALL, ANY, KEY_RUNS, MAX, MIN, SUM}; @@ -46,38 +48,119 @@ pub struct FrozenWord { /// Every name a view may give this position. The first is the R2IL /// opcode name. pub aliases: &'static [&'static str], + /// Which alias is this word's SQL name, if SQL has one. + pub sql_at: Option, + /// Which alias is this word's Quack name, if Quack has one. + pub quack_at: Option, } -const fn w(opcode: FnIndex, arity: u8, aliases: &'static [&'static str]) -> FrozenWord { +/// A language whose names a view gives the polyfill positions. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum AliasLanguage { + /// OGAR's R2IL opcode names. + R2il, + /// SQL keywords and operators. + Sql, + /// `lance-graph-quack` variant names (`Agg::*`, `Cmp::*`, `Filter::*`). + Quack, +} + +impl FrozenWord { + /// This word's name in `lang`, if that language has one. + #[must_use] + pub fn name_of(&self, lang: AliasLanguage) -> Option<&'static str> { + let at = match lang { + AliasLanguage::R2il => Some(0), + AliasLanguage::Sql => self.sql_at, + AliasLanguage::Quack => self.quack_at, + }; + at.and_then(|i| self.aliases.get(usize::from(i)).copied()) + } + + /// This word's name in `lang`, or its R2IL name where `lang` has none, + /// so a view always holds one label per position. + #[must_use] + pub fn name_in(&self, lang: AliasLanguage) -> &'static str { + self.name_of(lang).unwrap_or(self.aliases[0]) + } + + /// Whether `label` is one of this word's names. + #[must_use] + pub fn is_alias(&self, label: &str) -> bool { + self.aliases.contains(&label) + } +} + +const fn w( + opcode: FnIndex, + arity: u8, + aliases: &'static [&'static str], + sql_at: Option, + quack_at: Option, +) -> FrozenWord { FrozenWord { opcode, arity, aliases, + sql_at, + quack_at, } } /// The polyfill lens, by position. pub const POLYFILL: [FrozenWord; 17] = [ - w(INT_ADD, 2, &["IntAdd", "+"]), - w(INT_SUB, 2, &["IntSub", "-"]), - w(INT_MULT, 2, &["IntMult", "*"]), - w(INT_S_DIV, 2, &["IntSDiv", "/"]), - w(INT_EQUAL, 2, &["IntEqual", "=", "Cmp::EqI32", "Cmp::EqU32"]), - w(INT_S_LESS, 2, &["IntSLess", "<", "Cmp::LtI32"]), - w(INT_AND, 2, &["IntAnd", "AND", "Filter::and"]), - w(INT_OR, 2, &["IntOr", "OR", "Filter::or"]), - w(INT_XOR, 2, &["IntXor", "XOR"]), - w(INT_NOT, 1, &["IntNot", "NOT", "Filter::negate"]), - w(POP_COUNT, 1, &["PopCount", "COUNT", "Agg::Count"]), - w(SUM, 2, &["SUM", "Agg::SumI32"]), - w(MIN, 2, &["MIN", "Agg::MinI32"]), - w(MAX, 2, &["MAX", "Agg::MaxI32"]), - w(ANY, 1, &["ANY", "EXISTS", "Agg::Any"]), - w(ALL, 1, &["ALL", "Agg::All"]), + w(INT_ADD, 2, &["IntAdd", "+"], Some(1), None), + w(INT_SUB, 2, &["IntSub", "-"], Some(1), None), + w(INT_MULT, 2, &["IntMult", "*"], Some(1), None), + w(INT_S_DIV, 2, &["IntSDiv", "/"], Some(1), None), + w( + INT_EQUAL, + 2, + &["IntEqual", "=", "Cmp::EqI32", "Cmp::EqU32"], + Some(1), + Some(2), + ), + w( + INT_S_LESS, + 2, + &["IntSLess", "<", "Cmp::LtI32"], + Some(1), + Some(2), + ), + w( + INT_AND, + 2, + &["IntAnd", "AND", "Filter::and"], + Some(1), + Some(2), + ), + w(INT_OR, 2, &["IntOr", "OR", "Filter::or"], Some(1), Some(2)), + w(INT_XOR, 2, &["IntXor", "XOR"], Some(1), None), + w( + INT_NOT, + 1, + &["IntNot", "NOT", "Filter::negate"], + Some(1), + Some(2), + ), + w( + POP_COUNT, + 1, + &["PopCount", "COUNT", "Agg::Count"], + Some(1), + Some(2), + ), + w(SUM, 2, &["SUM", "Agg::SumI32"], None, Some(1)), + w(MIN, 2, &["MIN", "Agg::MinI32"], None, Some(1)), + w(MAX, 2, &["MAX", "Agg::MaxI32"], None, Some(1)), + w(ANY, 1, &["ANY", "EXISTS", "Agg::Any"], Some(1), Some(2)), + w(ALL, 1, &["ALL", "Agg::All"], None, Some(1)), w( KEY_RUNS, 2, &["KEY_RUNS", "COUNT DISTINCT", "Agg::CountDistinctOrderedU32"], + Some(1), + Some(2), ), ]; @@ -100,3 +183,101 @@ pub fn position_of(label: &str) -> Option { _ => None, } } + +/// The polyfill lens's labels in one language: a [`ClassView`] that answers +/// [`HARDCODED`] with one label per [`POLYFILL`] position, and nothing else. +/// +/// Every label is an alias of its own position, so +/// [`crate::binding::prepare`] binds the same plan from every language. A +/// field's `predicate_iri` names the word, not the language +/// (`lg:polyfill:f000/`); only the label changes. A position with +/// no name in the language is labelled with its R2IL name. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct PolyfillView { + lang: AliasLanguage, + labels: Vec, +} + +impl PolyfillView { + /// The view of the polyfill lens in `lang`. + #[must_use] + pub fn new(lang: AliasLanguage) -> Self { + let labels = POLYFILL + .iter() + .map(|w| { + FieldRef::new( + format!("lg:polyfill:f000/{}", w.aliases[0]), + w.name_in(lang), + ) + }) + .collect(); + Self { lang, labels } + } + + /// The language this view labels the positions in. + #[must_use] + pub fn language(&self) -> AliasLanguage { + self.lang + } +} + +impl ClassView for PolyfillView { + fn fields(&self, class: ClassId) -> &[FieldRef] { + if class == HARDCODED { + &self.labels + } else { + &[] + } + } + fn template(&self, _class: ClassId) -> DisplayTemplate { + DisplayTemplate::Detail + } + fn dolce_category_id(&self, _class: ClassId) -> u8 { + 0 + } +} + +/// A consumer's [`ClassView`] with [`HARDCODED`] answered by a +/// [`PolyfillView`]: every other concept, its template and its DOLCE +/// category, come from the consumer's view unchanged. The consumer's own +/// labels for [`HARDCODED`], if any, are not consulted. +/// +/// This routes one concept and checks nothing else; whether the caller's +/// classes are activated is not this adapter's question (D-DT64-7 L3). +#[derive(Debug, Clone, Copy)] +pub struct WithPolyfill<'a, V: ?Sized> { + inner: &'a V, + polyfill: &'a PolyfillView, +} + +impl<'a, V: ClassView + ?Sized> WithPolyfill<'a, V> { + /// `inner` with [`HARDCODED`] answered by `polyfill`. + #[must_use] + pub fn new(inner: &'a V, polyfill: &'a PolyfillView) -> Self { + Self { inner, polyfill } + } +} + +impl ClassView for WithPolyfill<'_, V> { + fn fields(&self, class: ClassId) -> &[FieldRef] { + if class == HARDCODED { + self.polyfill.fields(class) + } else { + self.inner.fields(class) + } + } + fn template(&self, class: ClassId) -> DisplayTemplate { + if class == HARDCODED { + self.polyfill.template(class) + } else { + self.inner.template(class) + } + } + fn dolce_category_id(&self, class: ClassId) -> u8 { + if class == HARDCODED { + self.polyfill.dolce_category_id(class) + } else { + self.inner.dolce_category_id(class) + } + } +} diff --git a/crates/lance-graph-r2il/tests/integration/main.rs b/crates/lance-graph-r2il/tests/integration/main.rs index ae0287139..84844de87 100644 --- a/crates/lance-graph-r2il/tests/integration/main.rs +++ b/crates/lance-graph-r2il/tests/integration/main.rs @@ -4,3 +4,4 @@ pub mod binding; pub mod binding_native; pub mod polyfill; +pub mod polyfill_views; diff --git a/crates/lance-graph-r2il/tests/integration/polyfill_views.rs b/crates/lance-graph-r2il/tests/integration/polyfill_views.rs new file mode 100644 index 000000000..f28bdb28c --- /dev/null +++ b/crates/lance-graph-r2il/tests/integration/polyfill_views.rs @@ -0,0 +1,252 @@ +//! The production alias views of the polyfill lens (D-DT64-7 L4): one +//! `ClassView` per language, derived from `POLYFILL`, and an adapter that +//! puts one over a consumer's own view. + +use lance_graph_contract::class_view::{ClassId, ClassView, WideFieldMask}; +use lance_graph_contract::ontology::{DisplayTemplate, FieldRef}; +use lance_graph_contract::set_rules::{Population, Truth}; +use lance_graph_dt64::dr::{Focus, FrameRevisions, FrameStore, Guards, Scope}; +use lance_graph_dt64::{ + AlgebraRef, Arg, BindStore, ClassSchema, Effect, Extent, MethodBinding, MethodId, MethodRef, + SchemaRev, SigRev, ValueDemand, +}; +use lance_graph_r2il::binding::{prepare, ExecRefusal, Prepared, R2ilLens, Resolution}; +use lance_graph_r2il::polyfill::{ + polyfill_arities, position_of, AliasLanguage, PolyfillView, WithPolyfill, HARDCODED, POLYFILL, + POLYFILL_LENS, +}; +use ogar_loco::Vocabulary; +use ogar_r2il::R2ILVocabulary; + +const LANGS: [AliasLanguage; 3] = [ + AliasLanguage::R2il, + AliasLanguage::Sql, + AliasLanguage::Quack, +]; + +// ----------------------------------------------------- the views themselves + +#[test] +fn each_language_view_labels_every_position_with_its_own_name() { + for lang in LANGS { + let v = PolyfillView::new(lang); + let fields = v.fields(HARDCODED); + assert_eq!(fields.len(), POLYFILL.len(), "{lang:?}: one label per word"); + for (p, w) in POLYFILL.iter().enumerate() { + let label = fields[p].label.as_str(); + assert_eq!(label, w.name_in(lang), "{lang:?} position {p}"); + assert!(w.is_alias(label), "{lang:?} position {p}: {label:?}"); + assert_eq!( + position_of(label), + u8::try_from(p).ok(), + "{lang:?}: {label:?} names exactly this position" + ); + } + } +} + +#[test] +fn the_word_identity_is_the_same_in_every_language() { + let views: Vec<_> = LANGS.into_iter().map(PolyfillView::new).collect(); + for p in 0..POLYFILL.len() { + let iris: Vec<&str> = views + .iter() + .map(|v| v.fields(HARDCODED)[p].predicate_iri.as_str()) + .collect(); + assert!(iris.iter().all(|i| *i == iris[0]), "position {p}: {iris:?}"); + } + // ...while the labels differ where the languages differ. + let lt = position_of("IntSLess").unwrap() as usize; + let labels: Vec<&str> = views + .iter() + .map(|v| v.fields(HARDCODED)[lt].label.as_str()) + .collect(); + assert_eq!(labels, ["IntSLess", "<", "Cmp::LtI32"]); +} + +#[test] +fn each_language_names_come_from_the_table_not_a_spelling_rule() { + for w in &POLYFILL { + assert_eq!(w.name_in(AliasLanguage::R2il), w.aliases[0]); + assert_eq!( + Some(w.name_in(AliasLanguage::R2il)), + R2ILVocabulary.name(w.opcode) + ); + for lang in [AliasLanguage::Sql, AliasLanguage::Quack] { + match w.name_of(lang) { + Some(n) => assert!(w.aliases[1..].contains(&n), "{n:?}"), + // No name in that language: the view falls back to the + // R2IL name, so the basis keeps one label per position. + None => assert_eq!(w.name_in(lang), w.aliases[0]), + } + } + } + // SUM has no SQL alias: SQL's SUM is NULL on an empty selection, + // this word is 0 (polyfill module doc). + let sum = &POLYFILL[position_of("SUM").unwrap() as usize]; + assert_eq!(sum.name_of(AliasLanguage::Sql), None); + let lt = &POLYFILL[position_of("IntSLess").unwrap() as usize]; + assert_eq!(lt.name_of(AliasLanguage::Sql), Some("<")); + assert_eq!(lt.name_of(AliasLanguage::Quack), Some("Cmp::LtI32")); +} + +#[test] +fn a_polyfill_view_answers_only_the_hardcoded_concept() { + let v = PolyfillView::new(AliasLanguage::Sql); + assert!(v.fields(0x7F0B).is_empty()); + assert_eq!(v.field_count(HARDCODED), POLYFILL.len()); +} + +// --------------------------------------- over a consumer view, through prepare + +const CLASS: u32 = 0x7F0B_0001; +const CLASS_VIEW: ClassId = 0x7F0B; +const REV: SchemaRev = SchemaRev(1); +const POSITION: u16 = 3; + +/// A consumer's own view: its class, and a stale label set for `0xFFFF` +/// that the adapter must hide. +struct Consumer { + class: Vec, + stale: Vec, +} + +impl Consumer { + fn new() -> Self { + Self { + class: ["a", "b", "k", "m", "s"] + .iter() + .map(|l| FieldRef::new(format!("lab:class/{l}"), *l)) + .collect(), + stale: vec![FieldRef::new("lab:stale", "MIN")], + } + } +} + +impl ClassView for Consumer { + fn fields(&self, class: ClassId) -> &[FieldRef] { + match class { + CLASS_VIEW => &self.class, + HARDCODED => &self.stale, + _ => &[], + } + } + fn template(&self, _class: ClassId) -> DisplayTemplate { + DisplayTemplate::Detail + } + fn dolce_category_id(&self, _class: ClassId) -> u8 { + 7 + } +} + +fn store() -> (BindStore, lance_graph_dt64::RouteVersion) { + let mut s = BindStore::new(); + s.declare_algebra(POLYFILL_LENS, REV, Extent::DR64_CUBE, polyfill_arities()) + .unwrap(); + let word = |name: &str| AlgebraRef { + lens: POLYFILL_LENS, + word: position_of(name).unwrap(), + }; + s.register( + CLASS, + ClassSchema { + schema_rev: REV, + field_count: 5, + extent: Extent::DR64_CUBE, + }, + vec![MethodBinding { + id: MethodId(1), + sig_rev: SigRev(1), + name: "sum_below".into(), + on: WideFieldMask::from_positions(&[0, 1]), + when: None, + reads: WideFieldMask::from_positions(&[0, 1]), + effects: vec![ + Effect { + target: 3, + algebra: word("IntSLess"), + args: vec![Arg::Field(0), Arg::Const(5)], + }, + Effect { + target: 4, + algebra: word("SUM"), + args: vec![Arg::Field(3), Arg::Field(1)], + }, + ], + population: Population::Distinct, + truth: Truth::TwoValued, + demand: ValueDemand::Values, + }], + ) + .unwrap(); + let v = s.route(POSITION, CLASS).unwrap(); + (s, v) +} + +fn prep(view: &V) -> Result { + let (s, version) = store(); + let frames = FrameStore::new(FrameRevisions { + source: 1, + relation_map: 1, + coordinates: 1, + }); + let now = (Focus { revision: 1 }, Scope { id: 1 }); + let r = MethodRef { + class: CLASS, + method: MethodId(1), + sig_rev: SigRev(1), + guard: None, + }; + let g = Guards { + frame: frames.seal(), + focus: now.0, + scope: now.1, + }; + prepare( + &s, + view, + R2ilLens { + lens: POLYFILL_LENS, + schema_rev: REV, + }, + &Resolution { + method: &r, + schema_rev: REV, + route: (version, POSITION), + guards: &g, + }, + &frames, + now, + ) +} + +#[test] +fn the_adapter_binds_the_same_plan_in_every_language() { + let consumer = Consumer::new(); + let plans: Vec = LANGS + .into_iter() + .map(|lang| { + let pv = PolyfillView::new(lang); + prep(&WithPolyfill::new(&consumer, &pv)).expect("prepares") + }) + .collect(); + for p in &plans[1..] { + assert_eq!(p.steps, plans[0].steps); + assert_eq!(p.plan_id, plans[0].plan_id); + } +} + +#[test] +fn the_adapter_hides_the_consumers_own_hardcoded_labels() { + let consumer = Consumer::new(); + // Twin: the consumer's view alone carries a one-label basis for 0xFFFF, + // so the lens's 17-word basis does not match it. + assert!(matches!(prep(&consumer), Err(ExecRefusal::Binding(_)))); + let pv = PolyfillView::new(AliasLanguage::Quack); + let both = WithPolyfill::new(&consumer, &pv); + assert_eq!(both.fields(HARDCODED).len(), POLYFILL.len()); + // Every other concept is the consumer's, including template and DOLCE. + assert_eq!(both.fields(CLASS_VIEW), consumer.fields(CLASS_VIEW)); + assert_eq!(both.template(CLASS_VIEW), DisplayTemplate::Detail); + assert_eq!(both.dolce_category_id(CLASS_VIEW), 7); +} From aac42f7053abb9568d85bdb616f2b81f01f97c96 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 21:18:31 +0000 Subject: [PATCH 2/4] board: L4 alias views entry Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF --- .../entries/2026-10-31-polyfill-alias-views-l4.md | 10 ++++++++++ .claude/board/entries/README.md | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .claude/board/entries/2026-10-31-polyfill-alias-views-l4.md diff --git a/.claude/board/entries/2026-10-31-polyfill-alias-views-l4.md b/.claude/board/entries/2026-10-31-polyfill-alias-views-l4.md new file mode 100644 index 000000000..019d5acc9 --- /dev/null +++ b/.claude/board/entries/2026-10-31-polyfill-alias-views-l4.md @@ -0,0 +1,10 @@ +# D-DT64-7 L4: production alias views for the polyfill lens — 2026-10-31 + +**Status:** MEASURED (`crates/lance-graph-r2il/tests/integration/polyfill_views.rs`). First step of the execution order in plan §1d. + +- Each `POLYFILL` word records which of its existing aliases is its SQL name and which its Quack name (`sql_at`, `quack_at`); no name is spelled twice and no spelling rule picks the language. `FrozenWord::{name_of, name_in, is_alias}`. +- `PolyfillView::new(AliasLanguage)` answers `0xFFFF` with one label per position. The `predicate_iri` names the word (`lg:polyfill:f000/`), the label the language; a position with no name in that language carries its R2IL name (SQL: `SUM`, `MIN`, `MAX`, `ALL`, where SQL's empty-selection `NULL` differs). +- `WithPolyfill::new(&consumer, &view)` answers `0xFFFF` from the polyfill view and delegates every other concept, template and DOLCE category to the consumer's view. It checks no activation (L3). +- Measured: R2IL, SQL and Quack views over the same consumer view bind the same steps and plan id; the consumer's own stale `0xFFFF` labels are refused alone and hidden behind the adapter. +- Disable runs, all red: SQL reading the Quack index (2 fail), one wrong index (2), no R2IL fallback (3), the polyfill view answering every concept (1), the adapter not routing `0xFFFF` (2), a per-language IRI (1), the adapter dropping the consumer's DOLCE category (1). +- Unchanged: `binding.rs`, the `0xC401` reading, the 9 existing polyfill tests. diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index 747048ea3..077152e62 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -25,7 +25,7 @@ index row, (3) no duplicate entry id. Checks 1 and 2 are deliberately opposite directions; the stranding this convention prevents shows up in exactly one of them, never both. -534 entries, 2026-08-06 .. 2026-10-31. +535 entries, 2026-08-06 .. 2026-10-31. | date | entry id | finding | file | |---|---|---|---| @@ -33,6 +33,7 @@ exactly one of them, never both. | 2026-10-31 | `r1-r2il-binding-reading` | | [2026-10-31-r1-r2il-binding-reading.md](2026-10-31-r1-r2il-binding-reading.md) | | 2026-10-31 | `r1-native-prepared-successor` | | [2026-10-31-r1-native-prepared-successor.md](2026-10-31-r1-native-prepared-successor.md) | | 2026-10-31 | `polyfill-positional-lens` | | [2026-10-31-polyfill-positional-lens.md](2026-10-31-polyfill-positional-lens.md) | +| 2026-10-31 | `D-DT64-7` | | [2026-10-31-polyfill-alias-views-l4.md](2026-10-31-polyfill-alias-views-l4.md) | | 2026-10-31 | `ogar-behavior-probe-p2-p3-p9` | | [2026-10-31-ogar-behavior-probe-p2-p3-p9.md](2026-10-31-ogar-behavior-probe-p2-p3-p9.md) | | 2026-10-31 | `D-SAG-6` | | [2026-10-31-kythe-bridge-ra-facts.md](2026-10-31-kythe-bridge-ra-facts.md) | | 2026-10-31 | `D-XLOG-NATIVE-6` | | [2026-10-31-d-xlog-native-6-ndarray-simd-execution.md](2026-10-31-d-xlog-native-6-ndarray-simd-execution.md) | From e0c14c76cdbe79d15e3b5493d40060b76b9003f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 21:25:07 +0000 Subject: [PATCH 3/4] DT64: behaviour lenses read their basis by the full classid (D-DT64-7 O9, L1) The contract's ClassView gains a defaulted lens_fields(u32), and is_behaviour_lens names a lens whose right half is 0xF000..=0xFFFF. BindStore::resolve_algebra reads such a lens's basis through lens_fields; a view that does not know it refuses with the new Refusal::UnknownLensBasis, and the concept's basis is never inherited. Every other lens, and every data class, keeps the left-half lookup, so the 0xC401 R2IL reading and existing lab lenses are unchanged. lance-graph-r2il follows: PolyfillView answers the polyfill lens through lens_fields and holds no concept basis; WithPolyfill routes lens_fields for lenses under 0xFFFF. The existing polyfill test view gains lens_fields; its assertions are unchanged. Tests (red first: 4 behavioural failures on the old resolve_algebra): two lenses under 0xFFFF with 17 and 5 words resolve independently; a data class and a behaviour lens sharing a left half do not cross-read; an unknown behaviour lens fails closed even when the concept's basis has the right count; a non-behaviour lens still reads its concept; a view without lens_fields compiles and refuses behaviour lenses. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF --- crates/lance-graph-contract/src/class_view.rs | 26 ++++ crates/lance-graph-dt64/src/lib.rs | 29 +++- crates/lance-graph-dt64/tests/bind_store.rs | 135 ++++++++++++++++++ crates/lance-graph-r2il/src/polyfill.rs | 33 +++-- .../tests/integration/polyfill.rs | 5 + .../tests/integration/polyfill_views.rs | 29 +++- 6 files changed, 237 insertions(+), 20 deletions(-) diff --git a/crates/lance-graph-contract/src/class_view.rs b/crates/lance-graph-contract/src/class_view.rs index db5a4c65e..4bf82cbf3 100644 --- a/crates/lance-graph-contract/src/class_view.rs +++ b/crates/lance-graph-contract/src/class_view.rs @@ -1046,6 +1046,14 @@ pub fn execute_defaults( /// "Single lookup" (leaf, today) vs "meta lookup" (the class, this trait): a /// single lookup is `uri → row`; a meta lookup is `class_id → shape`, composing /// many leaf lookups into one projected view. +/// Whether `classid` addresses a behaviour lens: its right (custom) half is +/// in `0xF000..=0xFFFF` (D-DT64-7 O9). A behaviour lens's basis is read with +/// [`ClassView::lens_fields`], by the full classid. +#[must_use] +pub const fn is_behaviour_lens(classid: u32) -> bool { + crate::ogar_codebook::split_classid(classid).1 >= 0xF000 +} + pub trait ClassView { /// The class's ordered field set — the bit basis. Position `i` in this slice /// is the stable [`FieldMask`] bit `i` (N3 append-only). This IS the @@ -1060,6 +1068,24 @@ pub trait ClassView { /// as the cache's opaque category id; the consumer maps it to its own enum. fn dolce_category_id(&self, class: ClassId) -> u8; + /// The field basis of the behaviour lens `lens`, by its FULL classid. + /// + /// A behaviour lens is a classid whose right (custom) half is in + /// `0xF000..=0xFFFF` ([`is_behaviour_lens`]). Several lenses can share a + /// left half (`0xFFFF_F000` and `0xFFFF_F200`, or a consumer's data class + /// `0x7F0B_0001` and its behaviour lens `0x7F0B_F001`), so their bases + /// cannot be read from [`fields`](Self::fields), which is keyed by the + /// left half alone. + /// + /// `None` means this view does not know the lens. A reader must then + /// refuse; it must not fall back to the left half's basis. The default + /// answers `None` for every lens, so a view that never implements this + /// keeps its current behaviour for every other classid. + fn lens_fields(&self, lens: u32) -> Option<&[FieldRef]> { + let _ = lens; + None + } + /// The label of field position `n` in `class`, resolved late from the cache /// (locale resolution is the consumer's job). `None` if `n` is out of range. fn field_label(&self, class: ClassId, n: u8) -> Option<&str> { diff --git a/crates/lance-graph-dt64/src/lib.rs b/crates/lance-graph-dt64/src/lib.rs index d6e4aecdd..9f5b7ccc6 100644 --- a/crates/lance-graph-dt64/src/lib.rs +++ b/crates/lance-graph-dt64/src/lib.rs @@ -78,7 +78,7 @@ use std::collections::BTreeMap; -use lance_graph_contract::class_view::{ClassId, ClassView, WideFieldMask}; +use lance_graph_contract::class_view::{is_behaviour_lens, ClassId, ClassView, WideFieldMask}; use lance_graph_contract::ogar_codebook::classid_concept; use lance_graph_contract::ontology::FieldRef; use lance_graph_contract::property::{PropertySchema, PropertySpec}; @@ -285,6 +285,9 @@ impl MethodRef { pub enum Refusal { /// The classid has no binding. UnknownClass(u32), + /// A behaviour lens (right half `0xF###`) whose basis the view does not + /// know by its full classid. It is never read from its left half. + UnknownLensBasis(u32), /// The classid is bound to other behaviour (D5). Override with a derived /// classid and a re-route. BehaviourImmutable(u32), @@ -669,6 +672,18 @@ impl BindStore { schema_rev: SchemaRev, ) -> Result, Refusal> { let bound = self.algebra.get(&lens).ok_or(Refusal::UnknownClass(lens))?; + if is_behaviour_lens(lens) { + let fields = view + .lens_fields(lens) + .ok_or(Refusal::UnknownLensBasis(lens))?; + return check_count(lens, &bound.schema, schema_rev, fields).map(|fields| Resolved { + class: lens, + schema: &bound.schema, + fields, + methods: &[], + derived_from: None, + }); + } check_basis(view, lens, &bound.schema, schema_rev).map(|fields| Resolved { class: lens, schema: &bound.schema, @@ -829,6 +844,17 @@ fn check_basis<'v, V: ClassView + ?Sized>( class: u32, schema: &ClassSchema, schema_rev: SchemaRev, +) -> Result<&'v [FieldRef], Refusal> { + check_count(class, schema, schema_rev, view.fields(view_class(class))) +} + +/// The revision and field-count checks of [`check_basis`], over a basis +/// already looked up. +fn check_count<'v>( + class: u32, + schema: &ClassSchema, + schema_rev: SchemaRev, + fields: &'v [FieldRef], ) -> Result<&'v [FieldRef], Refusal> { if schema.schema_rev != schema_rev { return Err(Refusal::SchemaRevisionMismatch { @@ -837,7 +863,6 @@ fn check_basis<'v, V: ClassView + ?Sized>( asked: schema_rev, }); } - let fields = view.fields(view_class(class)); if fields.len() != schema.field_count { return Err(Refusal::FieldBasisChanged { class, diff --git a/crates/lance-graph-dt64/tests/bind_store.rs b/crates/lance-graph-dt64/tests/bind_store.rs index ba5acfe6d..403dfca93 100644 --- a/crates/lance-graph-dt64/tests/bind_store.rs +++ b/crates/lance-graph-dt64/tests/bind_store.rs @@ -964,3 +964,138 @@ fn jina_reserves_the_dr256_identity_space_and_claims_only_routed_tiles() { "a refused route moves no version" ); } + +// -------------------------------------------------------------------------- +// D-DT64-7 O9 / L1: a behaviour lens (right half 0xF###) reads its basis by +// its full classid, through ClassView::lens_fields; it never inherits the +// basis of its left half. + +/// A view holding concept bases and behaviour-lens bases separately. +struct Lenses { + concepts: Vec<(ClassId, Vec)>, + lenses: Vec<(u32, Vec)>, +} + +fn labels(prefix: &str, n: usize) -> Vec { + (0..n) + .map(|i| FieldRef::new(format!("urn:{prefix}/{i}"), format!("{prefix}{i}"))) + .collect() +} + +impl ClassView for Lenses { + fn fields(&self, class: ClassId) -> &[FieldRef] { + self.concepts + .iter() + .find(|(c, _)| *c == class) + .map_or(&[], |(_, f)| f.as_slice()) + } + fn lens_fields(&self, lens: u32) -> Option<&[FieldRef]> { + self.lenses + .iter() + .find(|(l, _)| *l == lens) + .map(|(_, f)| f.as_slice()) + } + fn template(&self, _class: ClassId) -> DisplayTemplate { + DisplayTemplate::Detail + } + fn dolce_category_id(&self, _class: ClassId) -> u8 { + 0 + } +} + +const RELALG_LENS: u32 = 0xFFFF_F000; +const ONNX_LENS: u32 = 0xFFFF_F200; +const UNKNOWN_LENS: u32 = 0xFFFF_F300; + +#[test] +fn two_behaviour_lenses_under_one_left_half_resolve_independently() { + let mut s = BindStore::new(); + s.declare_algebra(RELALG_LENS, SchemaRev(1), Extent::DR64_CUBE, vec![2; 17]) + .unwrap(); + s.declare_algebra(ONNX_LENS, SchemaRev(1), Extent::DR64_CUBE, vec![1; 5]) + .unwrap(); + let view = Lenses { + // The concept 0xFFFF itself carries a basis of neither size. + concepts: vec![(0xFFFF, labels("concept", 3))], + lenses: vec![ + (RELALG_LENS, labels("relalg", 17)), + (ONNX_LENS, labels("onnx", 5)), + ], + }; + let relalg = s.resolve_algebra(&view, RELALG_LENS, SchemaRev(1)).unwrap(); + let onnx = s.resolve_algebra(&view, ONNX_LENS, SchemaRev(1)).unwrap(); + assert_eq!(relalg.fields.len(), 17); + assert_eq!(onnx.fields.len(), 5); + assert_eq!(relalg.fields[0].label, "relalg0"); + assert_eq!(onnx.fields[0].label, "onnx0"); +} + +#[test] +fn a_data_class_and_a_behaviour_lens_sharing_a_left_half_do_not_cross_read() { + const DATA: u32 = 0x7F0B_0001; + const LENS: u32 = 0x7F0B_F001; + let mut s = BindStore::new(); + s.register(DATA, schema(1, 2), vec![]).unwrap(); + s.declare_algebra(LENS, SchemaRev(1), Extent::DR64_CUBE, vec![1; 3]) + .unwrap(); + let view = Lenses { + concepts: vec![(0x7F0B, labels("data", 2))], + lenses: vec![(LENS, labels("word", 3))], + }; + let data = s.resolve(&view, DATA, SchemaRev(1)).unwrap(); + let lens = s.resolve_algebra(&view, LENS, SchemaRev(1)).unwrap(); + assert_eq!(data.fields.len(), 2); + assert_eq!(data.fields[1].label, "data1"); + assert_eq!(lens.fields.len(), 3); + assert_eq!(lens.fields[2].label, "word2"); +} + +#[test] +fn an_unknown_behaviour_lens_fails_closed_instead_of_inheriting_its_concept() { + let mut s = BindStore::new(); + s.declare_algebra(UNKNOWN_LENS, SchemaRev(1), Extent::DR64_CUBE, vec![1; 3]) + .unwrap(); + // The concept's basis has exactly the lens's word count: inheriting it + // would succeed, which is the failure this guards against. + let view = Lenses { + concepts: vec![(0xFFFF, labels("concept", 3))], + lenses: vec![], + }; + assert_eq!( + s.resolve_algebra(&view, UNKNOWN_LENS, SchemaRev(1)) + .unwrap_err(), + Refusal::UnknownLensBasis(UNKNOWN_LENS) + ); +} + +#[test] +fn a_lens_outside_the_behaviour_range_still_reads_its_concept() { + // Backward-compatibility twin: right half 0x0001 is not a behaviour + // lens, so the concept basis answers and `lens_fields` is not asked. + let mut s = BindStore::new(); + s.declare_algebra(POLYFILL, SchemaRev(1), Extent::DR64_CUBE, ARITY.to_vec()) + .unwrap(); + let view = Lenses { + concepts: vec![(view_class(POLYFILL), labels("w", ARITY.len()))], + lenses: vec![(POLYFILL, labels("ignored", 1))], + }; + let lens = s.resolve_algebra(&view, POLYFILL, SchemaRev(1)).unwrap(); + assert_eq!(lens.fields.len(), ARITY.len()); + assert_eq!(lens.fields[0].label, "w0"); +} + +#[test] +fn a_view_that_does_not_implement_lens_fields_still_compiles_and_refuses_behaviour_lenses() { + // `View` above implements only the required methods: the default + // `lens_fields` answers None, so a behaviour lens fails closed. + let mut s = BindStore::new(); + s.declare_algebra(RELALG_LENS, SchemaRev(1), Extent::DR64_CUBE, vec![1; 2]) + .unwrap(); + let view = View::with_fields(0xFFFF, 2); + assert_eq!(view.lens_fields(RELALG_LENS), None); + assert_eq!( + s.resolve_algebra(&view, RELALG_LENS, SchemaRev(1)) + .unwrap_err(), + Refusal::UnknownLensBasis(RELALG_LENS) + ); +} diff --git a/crates/lance-graph-r2il/src/polyfill.rs b/crates/lance-graph-r2il/src/polyfill.rs index 52a835b37..0666f515f 100644 --- a/crates/lance-graph-r2il/src/polyfill.rs +++ b/crates/lance-graph-r2il/src/polyfill.rs @@ -22,7 +22,7 @@ //! OGAR's `R2ILVocabulary` by test, not at run time. use lance_graph_contract::class_view::{ClassId, ClassView}; -use lance_graph_contract::ogar_codebook::compose_classid; +use lance_graph_contract::ogar_codebook::{classid_concept, compose_classid}; use lance_graph_contract::ontology::{DisplayTemplate, FieldRef}; use ogar_loco::FnIndex; use ogar_r2il::{ALL, ANY, KEY_RUNS, MAX, MIN, SUM}; @@ -184,8 +184,10 @@ pub fn position_of(label: &str) -> Option { } } -/// The polyfill lens's labels in one language: a [`ClassView`] that answers -/// [`HARDCODED`] with one label per [`POLYFILL`] position, and nothing else. +/// The polyfill lens's labels in one language: a [`ClassView`] whose +/// [`lens_fields`](ClassView::lens_fields) answers [`POLYFILL_LENS`] with one +/// label per [`POLYFILL`] position. It holds no concept basis: a behaviour +/// lens is read by its full classid (D-DT64-7 O9), never from [`HARDCODED`]. /// /// Every label is an alias of its own position, so /// [`crate::binding::prepare`] binds the same plan from every language. A @@ -222,12 +224,11 @@ impl PolyfillView { } impl ClassView for PolyfillView { - fn fields(&self, class: ClassId) -> &[FieldRef] { - if class == HARDCODED { - &self.labels - } else { - &[] - } + fn fields(&self, _class: ClassId) -> &[FieldRef] { + &[] + } + fn lens_fields(&self, lens: u32) -> Option<&[FieldRef]> { + (lens == POLYFILL_LENS).then_some(self.labels.as_slice()) } fn template(&self, _class: ClassId) -> DisplayTemplate { DisplayTemplate::Detail @@ -238,9 +239,10 @@ impl ClassView for PolyfillView { } /// A consumer's [`ClassView`] with [`HARDCODED`] answered by a -/// [`PolyfillView`]: every other concept, its template and its DOLCE -/// category, come from the consumer's view unchanged. The consumer's own -/// labels for [`HARDCODED`], if any, are not consulted. +/// [`PolyfillView`]: the concept `0xFFFF` and every lens under it come from +/// the polyfill view; every other concept and lens, template and DOLCE +/// category, from the consumer's view unchanged. The consumer's own labels +/// for `0xFFFF`, if any, are not consulted. /// /// This routes one concept and checks nothing else; whether the caller's /// classes are activated is not this adapter's question (D-DT64-7 L3). @@ -266,6 +268,13 @@ impl ClassView for WithPolyfill<'_, V> { self.inner.fields(class) } } + fn lens_fields(&self, lens: u32) -> Option<&[FieldRef]> { + if classid_concept(lens) == HARDCODED { + self.polyfill.lens_fields(lens) + } else { + self.inner.lens_fields(lens) + } + } fn template(&self, class: ClassId) -> DisplayTemplate { if class == HARDCODED { self.polyfill.template(class) diff --git a/crates/lance-graph-r2il/tests/integration/polyfill.rs b/crates/lance-graph-r2il/tests/integration/polyfill.rs index ab9766e1c..adab6b77c 100644 --- a/crates/lance-graph-r2il/tests/integration/polyfill.rs +++ b/crates/lance-graph-r2il/tests/integration/polyfill.rs @@ -134,6 +134,11 @@ impl ClassView for Views { _ => &[], } } + // D-DT64-7 O9: the polyfill lens is a behaviour lens, read by its full + // classid. + fn lens_fields(&self, lens: u32) -> Option<&[FieldRef]> { + (lens == POLYFILL_LENS).then_some(self.lens.as_slice()) + } fn template(&self, _class: ClassId) -> DisplayTemplate { DisplayTemplate::Card } diff --git a/crates/lance-graph-r2il/tests/integration/polyfill_views.rs b/crates/lance-graph-r2il/tests/integration/polyfill_views.rs index f28bdb28c..2371d8cc0 100644 --- a/crates/lance-graph-r2il/tests/integration/polyfill_views.rs +++ b/crates/lance-graph-r2il/tests/integration/polyfill_views.rs @@ -30,7 +30,7 @@ const LANGS: [AliasLanguage; 3] = [ fn each_language_view_labels_every_position_with_its_own_name() { for lang in LANGS { let v = PolyfillView::new(lang); - let fields = v.fields(HARDCODED); + let fields = v.lens_fields(POLYFILL_LENS).expect("the polyfill lens"); assert_eq!(fields.len(), POLYFILL.len(), "{lang:?}: one label per word"); for (p, w) in POLYFILL.iter().enumerate() { let label = fields[p].label.as_str(); @@ -51,7 +51,11 @@ fn the_word_identity_is_the_same_in_every_language() { for p in 0..POLYFILL.len() { let iris: Vec<&str> = views .iter() - .map(|v| v.fields(HARDCODED)[p].predicate_iri.as_str()) + .map(|v| { + v.lens_fields(POLYFILL_LENS).unwrap()[p] + .predicate_iri + .as_str() + }) .collect(); assert!(iris.iter().all(|i| *i == iris[0]), "position {p}: {iris:?}"); } @@ -59,7 +63,7 @@ fn the_word_identity_is_the_same_in_every_language() { let lt = position_of("IntSLess").unwrap() as usize; let labels: Vec<&str> = views .iter() - .map(|v| v.fields(HARDCODED)[lt].label.as_str()) + .map(|v| v.lens_fields(POLYFILL_LENS).unwrap()[lt].label.as_str()) .collect(); assert_eq!(labels, ["IntSLess", "<", "Cmp::LtI32"]); } @@ -91,10 +95,16 @@ fn each_language_names_come_from_the_table_not_a_spelling_rule() { } #[test] -fn a_polyfill_view_answers_only_the_hardcoded_concept() { +fn a_polyfill_view_answers_only_the_polyfill_lens() { let v = PolyfillView::new(AliasLanguage::Sql); + assert_eq!( + v.lens_fields(POLYFILL_LENS).map(<[_]>::len), + Some(POLYFILL.len()) + ); + // O9: no concept basis, and no other lens under the same left half. + assert!(v.fields(HARDCODED).is_empty()); assert!(v.fields(0x7F0B).is_empty()); - assert_eq!(v.field_count(HARDCODED), POLYFILL.len()); + assert_eq!(v.lens_fields(0xFFFF_F200), None); } // --------------------------------------- over a consumer view, through prepare @@ -244,7 +254,14 @@ fn the_adapter_hides_the_consumers_own_hardcoded_labels() { assert!(matches!(prep(&consumer), Err(ExecRefusal::Binding(_)))); let pv = PolyfillView::new(AliasLanguage::Quack); let both = WithPolyfill::new(&consumer, &pv); - assert_eq!(both.fields(HARDCODED).len(), POLYFILL.len()); + assert_eq!( + both.lens_fields(POLYFILL_LENS).map(<[_]>::len), + Some(POLYFILL.len()) + ); + assert!( + both.fields(HARDCODED).is_empty(), + "the stale labels are hidden" + ); // Every other concept is the consumer's, including template and DOLCE. assert_eq!(both.fields(CLASS_VIEW), consumer.fields(CLASS_VIEW)); assert_eq!(both.template(CLASS_VIEW), DisplayTemplate::Detail); From 67243df8f1f3e6ab5f0d2a5d9697a8f3d4a70bf8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 21:27:05 +0000 Subject: [PATCH 4/4] board: L1 entry (full-classid basis for behaviour lenses) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF --- ...26-10-31-behaviour-lens-full-classid-l1.md | 21 +++++++++++++++++++ .claude/board/entries/README.md | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .claude/board/entries/2026-10-31-behaviour-lens-full-classid-l1.md diff --git a/.claude/board/entries/2026-10-31-behaviour-lens-full-classid-l1.md b/.claude/board/entries/2026-10-31-behaviour-lens-full-classid-l1.md new file mode 100644 index 000000000..367c8a278 --- /dev/null +++ b/.claude/board/entries/2026-10-31-behaviour-lens-full-classid-l1.md @@ -0,0 +1,21 @@ +# D-DT64-7-L1: behaviour lenses read their basis by the full classid — 2026-10-31 + +**Status:** MEASURED (`crates/lance-graph-dt64/tests/bind_store.rs`, `crates/lance-graph-r2il/tests/integration/polyfill*.rs`). Implements decision O9 (plan §1d), step 2 of the execution order. + +## Contract change and its compatibility impact +- `lance_graph_contract::class_view::ClassView` gains `fn lens_fields(&self, lens: u32) -> Option<&[FieldRef]>` with a default that returns `None`. **Source-compatible:** every existing `impl ClassView` compiles unchanged (a test pins this with a view that implements only the required methods). +- New `class_view::is_behaviour_lens(classid) -> bool`: right (custom) half in `0xF000..=0xFFFF`. +- `lance_graph_dt64::Refusal` gains `UnknownLensBasis(u32)`. No crate matches `Refusal` exhaustively (searched across `crates/`), so no match breaks. + +## Behaviour change +- `BindStore::resolve_algebra` reads a behaviour lens's basis through `lens_fields(lens)`. `None` refuses with `UnknownLensBasis`; the left half's basis is never inherited, even when its field count matches. +- Unchanged: every lens with a right half below `0xF000` (the `0xC401` R2IL reading, the lab lenses `0x7F0A_0001` and friends) and every data class (`resolve`) keep the left-half lookup. +- The one lens on `main` this moves is the polyfill lens `0xFFFF_F000` (#1899). A caller that passed a view answering it only through `fields(0xFFFF)` now gets `UnknownLensBasis`, which is O9's intent. `PolyfillView` answers it through `lens_fields` and no longer holds a concept basis; `WithPolyfill` routes `lens_fields` for lenses under `0xFFFF`. The existing polyfill test view gained `lens_fields`; its assertions are unchanged. + +## Measured +- Red first: on the old `resolve_algebra`, 4 of the 5 new DT64 tests failed; the compatibility twin passed. +- Two lenses under `0xFFFF` with 17 and 5 words resolve independently; a data class `0x7F0B_0001` and a behaviour lens `0x7F0B_F001` do not cross-read; an unknown behaviour lens refuses even when the concept's basis has the right count. +- Disable runs, all red: behaviour branch off (4 fail), inherit the concept basis on an unknown lens (2), every lens treated as a behaviour lens (2), `WithPolyfill` not routing `lens_fields` (2). +- Dependents checked: `lance-graph-contract` (1562 + others), `lance-graph-dt64`, `lance-graph-r2il`, `xlog-relcomp-probe`, `dt64-admission-probe` green; their lenses use right halves `0x0000`/`0x0001`. + +Not widened: `AlgebraRef.word`, `WideFieldMask`, the 256-position limit. diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index 077152e62..0e62185b8 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -25,7 +25,7 @@ index row, (3) no duplicate entry id. Checks 1 and 2 are deliberately opposite directions; the stranding this convention prevents shows up in exactly one of them, never both. -535 entries, 2026-08-06 .. 2026-10-31. +536 entries, 2026-08-06 .. 2026-10-31. | date | entry id | finding | file | |---|---|---|---| @@ -48,6 +48,7 @@ exactly one of them, never both. | 2026-10-31 | `D-DYNBAG-X` | | [2026-10-31-cross-frontend-projection-crosswalk.md](2026-10-31-cross-frontend-projection-crosswalk.md) | | 2026-10-31 | `coresearch-mandatory-codegraph` | | [2026-10-31-coresearch-mandatory-codegraph.md](2026-10-31-coresearch-mandatory-codegraph.md) | | 2026-10-31 | `D-STAUNEN` | | [2026-10-31-coresearch-d-staunen-arc.md](2026-10-31-coresearch-d-staunen-arc.md) | +| 2026-10-31 | `D-DT64-7-L1` | | [2026-10-31-behaviour-lens-full-classid-l1.md](2026-10-31-behaviour-lens-full-classid-l1.md) | | 2026-10-30 | `D-XLOG-NATIVE-0` | | [2026-10-30-d-xlog-native-crosswalk.md](2026-10-30-d-xlog-native-crosswalk.md) | | 2026-10-30 | `D-XLOG-DR64-0` | XLOG's CPU frontend lowers onto DR64 relcomp (answer {2}, 2 oracles); its optimizer emits ChainJoin and swapped orders; arrow 60 vs 58 blocks in-tree use; masks lose to scalar on selective data | [2026-10-30-d-xlog-dr64-0-xlog-rir-over-dr64-relcomp.md](2026-10-30-d-xlog-dr64-0-xlog-rir-over-dr64-relcomp.md) | | 2026-10-30 | `D-TRACT-SHAPE-1` | | [2026-10-30-d-tract-shape-1-cold-shape-folding.md](2026-10-30-d-tract-shape-1-cold-shape-folding.md) |