Skip to content

feat(blasgraph): CscStorage, HyperCSR, TypedGraph, planner, SIMD Hamming#29

Merged
AdaWorldAPI merged 1 commit intomainfrom
claude/review-lance-graph-pr-20-PCNBP
Mar 22, 2026
Merged

feat(blasgraph): CscStorage, HyperCSR, TypedGraph, planner, SIMD Hamming#29
AdaWorldAPI merged 1 commit intomainfrom
claude/review-lance-graph-pr-20-PCNBP

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Session A deliverables:

D1 — CscStorage: Compressed Sparse Column with from_csr/to_csr/column_iter.
GrBMatrix now holds dual CSR+CSC; transpose is zero-copy when CSC present.

D2 — HyperCsrStorage: only stores non-empty rows for power-law graphs
(saves 997+ row pointers on sparse 1000-node graphs).
StorageFormat enum with 6 variants (3 implemented, 3 reserved).

D3 — TypedGraph: one matrix per relationship type, one mask per label.
traverse/multi_hop/masked_traverse + from_spo_store bridge.
apply_truth_gate for post-hoc TruthGate filtering (W4-7).

D4 — blasgraph_planner: compile_to_blasgraph maps LogicalOperator to grb_mxm.
ScanByLabel→diagonal, Expand→mxm, VariableLengthExpand→iterated mxm.
ExecutionStrategy::BlasGraph added to query.rs.

D5 — SIMD Hamming: AVX-512 VPOPCNTDQ → AVX2 lookup → scalar fallback.
Runtime dispatch via is_x86_feature_detected. All paths produce
identical results (verified by test_simd_hamming_matches_scalar).

193 blasgraph tests pass, 30 SPO tests unchanged.

https://claude.ai/code/session_01ReBmBKt1UwSPBcSdAdcaXK

Session A deliverables:

D1 — CscStorage: Compressed Sparse Column with from_csr/to_csr/column_iter.
     GrBMatrix now holds dual CSR+CSC; transpose is zero-copy when CSC present.

D2 — HyperCsrStorage: only stores non-empty rows for power-law graphs
     (saves 997+ row pointers on sparse 1000-node graphs).
     StorageFormat enum with 6 variants (3 implemented, 3 reserved).

D3 — TypedGraph: one matrix per relationship type, one mask per label.
     traverse/multi_hop/masked_traverse + from_spo_store bridge.
     apply_truth_gate for post-hoc TruthGate filtering (W4-7).

D4 — blasgraph_planner: compile_to_blasgraph maps LogicalOperator to grb_mxm.
     ScanByLabel→diagonal, Expand→mxm, VariableLengthExpand→iterated mxm.
     ExecutionStrategy::BlasGraph added to query.rs.

D5 — SIMD Hamming: AVX-512 VPOPCNTDQ → AVX2 lookup → scalar fallback.
     Runtime dispatch via is_x86_feature_detected. All paths produce
     identical results (verified by test_simd_hamming_matches_scalar).

193 blasgraph tests pass, 30 SPO tests unchanged.

https://claude.ai/code/session_01ReBmBKt1UwSPBcSdAdcaXK
@AdaWorldAPI AdaWorldAPI merged commit 2a7c44a into main Mar 22, 2026
AdaWorldAPI pushed a commit that referenced this pull request Mar 22, 2026
…stale markers

Phase 1 (Session A): ✅ DONE — PR #29 merged all deliverables
Phase 2 (Session B): ⚡ PARTIAL — container.rs done (PR #28), semiring/VSA/SIMD remaining
SESSION_B_HDR_RENAME: marked DONE (Cascade exists in hdr.rs)
SESSION_FALKORDB_CROSSCHECK: marked SUPERSEDED by session_D_v3
Integration-lead + master map + phases updated with current status.
AdaWorldAPI pushed a commit that referenced this pull request Apr 19, 2026
Per procedure-bookkeeping.md Pass 2: classify each "none" row from
Pass 1 as superseded / live / archived.

Result: 25 open → 13 superseded, 6 live, 6 archived.

Superseded (shipped under overlapping PRs):
  FINAL_MAP (#65), session_A_v3 (Phase 1 #29), session_B_v3 (Phase 2),
  session_6d (#78), session_bgz17_similarity (#40),
  session_unified_26_epiphanies (#60), session_ontology_layer_audit (#155),
  research_quantized_graph_algebra (#186-198), session_MASTER_map_v3,
  session_{integration,master,model}_plan (elegant-herding-rocket)

Live (aligned to active phases):
  P18_INTERNAL_LLM (Phase 8 D2), SCOPED_PROMPTS (refresh candidate),
  arxiv (governance), session_C_v3 (Phase 3 Lane A), session_D_v3
  (Phase 4), session_epiphany_integration (Phase 8),
  session_unified_vector_search (Phase 3 cross-repo)

Archived (moved to prompts/archive/ in prior commit):
  6 audio/codec/fisher-z files

https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
AdaWorldAPI added a commit that referenced this pull request May 6, 2026
…ts, name CycleAccumulator distinct from per-row CollapseGate

Canonical reference for the architecture so future sessions stop re-inventing the
conflation between the two ontologies. Pins:

- Three nested layers in one binary (BindSpace SoA / callcenter ecosystem ontology
  / outbound sinks past tokio)
- Four invariants: I-1 single binary + full lance-graph dep, I-2 tokio outbound only,
  I-3 BBB compile-time enforced (external_membrane.rs:7-13), I-4 per-row vs per-cadence
  gates are distinct primitives
- Names CycleAccumulator (new, missing primitive) distinct from existing
  collapse_gate::GateDecision (per-row, 2-byte airgap) — closes the third
  GATE-namespace clash before it lands as an entropy-ledger row
- Locates the four in-flight integration plans on the diagram
- Cross-references PR #29 (smb-office-rs SmbMembraneGate) as the first concrete
  POLICY-1 closure on the consumer side

Driven by feedback from another session that watched three different "where does
the consumer live" framings emerge over two weeks. Pinning the names now while
PR #29 is fresh as a reference point.
AdaWorldAPI added a commit that referenced this pull request May 6, 2026
… 30-LOC mirror)

Documents the workspace-shape mismatch discovered while attempting to mirror
smb-office-rs PR #29 onto the medcare consumer side: medcare-rs lacks the
prerequisite scaffolding crates (medcare-realtime + medcare-rbac) that
smb-office-rs already had.

Total estimated scope: ~800 LOC across 3-stage scaffolding sequence:
1. medcare-rbac crate scaffold (~300 LOC) — Policy/Role/Operation/AccessDecision
2. medcare-realtime crate skeleton (~200 LOC) — feature gates, MedCareStack
3. MedCareMembraneGate impl (~300 LOC) — the gate itself, mirroring PR #29

Three options surfaced (no decision yet): full scaffolding sprint, defer until
DM-7+DM-8 land, or parallel-track Stage 1 only.

Marker file so future sessions don't re-discover the gap mid-PR. Cross-refs
the topology doc's "~30 LOC" estimate which needs correction once this
scaffolding decision is made.
AdaWorldAPI added a commit that referenced this pull request May 6, 2026
…int (12 + 3 agents)

Creates the coordination surface for the 3-stage MedCare scaffolding sprint:
12 worker agents (4 per stage) + 3 meta agents (1 per stage), each writing
append-only log entries to .claude/board/sprint-log/agents/ (the GitHub-MCP
equivalent of `tee -a /var/log/sprint.log`).

Sprint manifest pins:
- Goal: close MEDCARE_POLICY_GAP.md Stages 1+2+3 in one sprint
- Branch: claude/lance-datafusion-integration-gv0BF on both medcare-rs and
  lance-graph (worker commits go to medcare-rs, sprint-log + meta reviews
  go to lance-graph)
- References each agent uses (lance-graph-rbac, smb-realtime, PR #29)
- Per-round acceptance criteria + per-agent file ownership

Append-only governance: per-agent files immutable; revisions spawn new files.
Status table at the top is the only mutable surface in this file.
AdaWorldAPI added a commit that referenced this pull request May 6, 2026
…e (sprint closure)

Meta-3 final review surfaces 5 findings; ZERO CRITICAL:

HIGH #1: Action operations (Operation::Act) unreachable via gate
  → Doc note recommended; orchestration layer is the right home for action gating
HIGH #2: BtM Escalate "v1 limitation" tests use loose is_allowed() assertions
  → Recommend tightening to explicit assert_eq!(AccessDecision::Allow)
    for clearer future test-failure messages

MEDIUM #3: Three name paths for Policy (rbac, gate, lib)
  → Backlog; doc-only canonicalization
MEDIUM #4: 20-200 ns gate decision claim unbenchmarked
  → Backlog; criterion-based gate-bench follow-up
LOW #5: TD-MEMBRANE-FIRST-VS-ANY untested
  → Backlog; vacuous in v1 without divergence case

Sprint-wide closure:
- Round 1 (medcare-rbac): 26 tests, solid, 2 CRITICAL fixes applied
- Round 2 (medcare-realtime skeleton): 5 tests, 1 CRITICAL casing+HIPAA fix
- Round 3 (gate impl): 33 tests, 2 HIGH documentation gaps
- Total: 64 tests across 3 crates

VERDICT: Ship. POLICY-1 medcare-side seam CLOSED for v1. Topology I-1/I-2/I-3/I-4
upheld. PR #29 three TD caveats honestly carried forward.
AdaWorldAPI added a commit that referenced this pull request May 6, 2026
…closure

12 workers + 3 metas across 3 rounds, 4 CRITICAL fixes applied as inline
revisions (W3-rev2, W4-rev2, W7-rev2). Meta-3 final verdict: SHIP.

Total shipped:
- medcare-rs: 14 commits, 13 files, ~1,865 LOC, 64 tests
- lance-graph sprint-log: 21 commits (12 agent logs + 3 meta reviews +
  scaffolding + this synthesis)

POLICY-1 / MEMBRANE-GATE-1 medcare-side seam: SHIPPED v1
- Mirror of smb-office-rs#29 with regulatory adaptations
- Three TD caveats from PR #29 honestly carried forward
- Topology I-1/I-2/I-3/I-4 invariants preserved

Outstanding from Meta-3 (backlog):
- HIGH #1: Action ops doc note (5 min)
- HIGH #2: Tighten v1-limit assertions (10 min)
- MEDIUM #3-#4: Policy name canonicalization + bench harness
- LOW #5: TD-MEMBRANE-FIRST-VS-ANY test (vacuous in v1)

Synthesis includes:
- Findings summary (4 CRITICAL applied + 2 HIGH backlog)
- Topology invariant preservation table
- Upstream gaps surfaced (StepDomain verified, BMV-Ä retention, BtM Escalate)
- Test posture per-crate
- Recommended follow-up sprint scope (~half day)
- What the cca2a pattern validated this run
- Full branch state at sprint closure (commit lists for both repos)

Ready for CI verification + PR to medcare-rs main.
AdaWorldAPI added a commit that referenced this pull request May 6, 2026
…PY_LEDGER

Append-only update to the entropy ledger per its own Update Protocol.
Records:

State changes:
- WATCHER-1: Stalled → Wired (sync, std-only) per topology I-2.
  Evidence: PR #337 (commit c1fc1e5). Transport layer correct;
  MVCC bind to Dataset::checkout_latest().version() still pending.
  Entropy 4 → 3.
- POLICY-1 / MEMBRANE-GATE-1: Stalled → Wired on BOTH consumer sides
  via newtype-bridge pattern. SMB side (smb-office-rs#29 — SmbMembraneGate
  over Arc<lance_graph_rbac::Policy>) + medcare side (medcare-rs#98 —
  MedCareMembraneGate over Arc<medcare_rbac::Policy>, with 12+3 agent
  sprint trail at .claude/board/sprint-log/). 4 CRITICAL fixes applied
  during sprint (BMV-Ä §57 Anamnese append-only, receptionist clinical-
  blind safety, StepDomain::Medcare casing + HIPAA values, policy.rs
  test alignment). Entropy 4 → 2 / 3 → 2.
- SPLAT-1: stage advance via PR #336 + #344. 22 splat tests now passing.

New rows:
- CYCLE-ACCUM-1: per-cadence flush gate, distinct from collapse_gate
  per topology I-4. Wired in PR #337 with 11 tests. Entropy 2.
- LADYBUG-EQUIV-1: ladybug-rs ↔ lance-graph equivalence closure.
  Documented mapping (clam_path ≅ cam_pq, nsm_substrate ≅ deepnsm,
  sentence_crystal ≅ holograph, DN-tree binding ≅ holograph::dntree,
  etc.). Verdict: harvest empty. Entropy 1 (clean closure).

Workspace crate inventory expansion: prior models tracked ~5 crates;
canonical inventory is ~22 (lance-graph + lance-graph-contract +
lance-graph-planner + lance-graph-callcenter + lance-graph-rbac +
lance-graph-archetype + lance-graph-catalog + lance-graph-cognitive +
cognitive-shader-driver + deepnsm + holograph + bgz-tensor +
highheelbgz + reader-lm + jc + thinking-engine + neural-debug +
learning + causal-edge + medcare-rs/{medcare-rbac,medcare-realtime,...} +
smb-office-rs/{smb-realtime,...} + q2/cockpit-server).

Cross-references: .claude/patterns.md (NEW, commit cd95da9) — graph-
traversal usability guide. SINGLE_BINARY_TOPOLOGY.md — three-layer
invariants. MEDCARE_POLICY_GAP.md — scoping. CROSS_REPO_PRS.md —
append-only external-repo log. sprint-log/ — 12+3 agent sprint trail.

Open seams: 8 → 5 (3 closed via PR #337 + #29 + #98).

Pre-work checklist for future sessions added — the load-bearing surface
that prevents the discovery-loop cost this session paid (~10 rounds of
"is X new?" → "no, X exists at Y").

[Note: this branch's pre-existing ledger state was stale; this commit
writes [main_content + 2026-05-06 dated append] so the user-side merge
keeps everything from main plus the new section.]
AdaWorldAPI added a commit that referenced this pull request May 7, 2026
Three architectural docs from the
claude/lance-datafusion-integration-gv0BF branch landing on main per
user 2026-05-07.

- CROSS_REPO_PRS.md (.claude/board/) — append-only log of merged PRs
  in OTHER AdaWorldAPI repos that touch lance-graph topology
  (smb-office-rs#29, q2#35, MedCareV2#7, MedCareV2#8). Captures
  topology placement, ledger row anchors, MCP scope marker for
  out-of-allowlist repos.

- MEDCARE_POLICY_GAP.md (.claude/board/) — finding doc identifying
  that medcare-rs lacked the prerequisite scaffolding (medcare-rbac
  + medcare-realtime crates) for a "30-LOC mirror" of PR #29's
  SmbMembraneGate. Real lift: ~800 LOC across 3-stage scaffolding
  sequence. Used to scope PR #98 (now merged).

- .claude/patterns.md (PLURAL — sibling of pattern.md from PR #345)
  — traversal patterns guide: 5 patterns (CRATE-FIRST, REGION-FIRST,
  ENTROPY-FIRST, APPEND-ONLY, CLUSTER-AWARE), 22-crate inventory,
  ladybug-rs equivalence map, 5 anti-patterns, 6 wiring recipes
  (CAM-DIST-1, PARSER-1, DEEPNSM-NSM-1, VSA-1, MEMBRANE-GATE-1
  done, WATCHER-1 done), pre-work checklist.

Open question: pattern.md (singular, PR #345) vs patterns.md
(plural, this session) filename collision now visible on main. The
plural file documents Single-Name Lookup as anti-pattern — meta-
irony of the collision is acknowledged. Recommendation: rename
pattern.md → patterns.md and absorb both bodies. Awaiting user
decision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants