Skip to content

feat: cognitive-shader-driver — BindSpace + shader integration#204

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/teleport-session-setup-wMZfb
Apr 18, 2026
Merged

feat: cognitive-shader-driver — BindSpace + shader integration#204
AdaWorldAPI merged 3 commits into
mainfrom
claude/teleport-session-setup-wMZfb

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

  • New crate cognitive-shader-driver (24 tests) — the CognitiveShader IS the driver. Holds BindSpace struct-of-arrays (FingerprintColumns, EdgeColumn, QualiaColumn, packed MetaColumn), dispatches cycles through p64-bridge CognitiveShader + bgz17 O(1) distance, emits cycle_fingerprint + CausalEdge64 through ShaderSink callbacks
  • New cognitive_shader.rs in lance-graph-contract (8 tests) — zero-dep DTO API: ShaderDispatch→ShaderResonance→ShaderBus→ShaderCrystal, MetaWord(u32) packed prefilter, CognitiveShaderDriver trait, ShaderSink commit-adapter pattern
  • Auto-style from 18D qualiaauto_style.rs routes qualia shape to 12 thinking styles without forward pass
  • EmbedAnything patterns applied: fluent builder, auto-detect, commit sinks, feature gates (with-engine)
  • Full ladybug-rs import (earlier commits): grammar, spo, learning, world, search, fabric, spectroscopy, container_bs, core_full — 630K LOC across lance-graph-cognitive + standalone learning crate
  • holograph crate imported from RedisGraph, migrated 10K→16K width
  • Contract extensions: Container/CogRecord (16K), CollapseGate + GateDecision + MergeMode
  • Knowledge + docs: 8 eras historical context, integration plan, session handoff priorities, cognitive-shader-architecture canonical doc

Test plan

  • cargo test -p lance-graph-contract — 68 tests (including 8 new cognitive_shader tests)
  • cargo test -p cognitive-shader-driver — 16 tests (builder, dispatch, prefilter, sink, auto-style, bindspace)
  • cargo check — workspace compiles clean (warnings only)
  • Verify cargo test -p p64-bridge still passes (6 existing tests)
  • Verify cargo test -p lance-graph-planner still passes

https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh

claude added 3 commits April 18, 2026 15:17
bitpacked_to_fingerprint() and fingerprint_to_bitpacked() bridge
holograph's BitpackedVector (16K) ↔ ndarray Fingerprint<256>.
Same backing store, different types. Zero-copy via from_words.

https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
QW1+QW2: bitpacked_to_fingerprint() / fingerprint_to_bitpacked()
QW7: spo/mod.rs, bulk similarity() → unwrap_or(0.0) fix
SPO: 26 errors remain (BindSpace stubs needed), gated behind wip

All 7 quick wins addressed. Grammar + world compile clean.

https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
…t-of-arrays

Role reversal: CognitiveShader no longer sits below thinking-engine.
It drives the cycle: reads BindSpace columns (struct-of-arrays with
packed u32 MetaColumn prefilter), dispatches bgz17 O(1) cascade through
8 predicate planes, emits cycle_fingerprint + CausalEdge64 through
EmbedAnything-pattern commit sinks.

New crate: cognitive-shader-driver (16 tests)
  - bindspace.rs: FingerprintColumns, EdgeColumn, QualiaColumn, MetaColumn
  - driver.rs: ShaderDriver + CognitiveShaderBuilder (fluent API)
  - auto_style.rs: 18D qualia → style ordinal (auto-detect)

New in lance-graph-contract (zero-dep DTOs):
  - cognitive_shader.rs: ShaderDispatch→ShaderResonance→ShaderBus→ShaderCrystal
  - MetaWord(u32): thinking(6b)+awareness(4b)+nars_f(8b)+nars_c(8b)+free_e(6b)
  - MetaFilter, ShaderSink trait, CognitiveShaderDriver trait
  - 8 tests passing

https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
@AdaWorldAPI AdaWorldAPI merged commit 0cd0d41 into main Apr 18, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca90f90019

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +101 to +103
hits.push(ShaderHit {
row,
distance: hit.distance,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use cascade targets when recording hit rows

run() currently stores row (the source row being iterated) in each ShaderHit, even though shader.cascade() returns matched target indices per hit. This causes top-k to rank repeated copies of the query row instead of actual matches, and cycle_fingerprint then folds the wrong BindSpace fingerprints. Any dispatch where cascade returns targets different from the query row will produce incorrect resonance and cycle outputs.

Useful? React with 👍 / 👎.

Comment on lines +201 to +203
let persisted_row = match req.emit {
EmitMode::Persist => Some(resonance_dto.top_k[0].row),
_ => None,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Skip persisted_row assignment when no hits are found

In EmitMode::Persist, persisted_row is always taken from top_k[0].row, but top_k is zero-initialized when no hits pass filtering/cascade. This means an empty result set can incorrectly report persisted_row = Some(0), which can falsely signal a commit to row 0 when the dispatch actually found nothing (e.g., strict prefilter, empty layer mask, or tiny radius).

Useful? React with 👍 / 👎.

Comment on lines +137 to +139
h.row as u8,
0,
h.row as u8,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent row index truncation when emitting causal edges

Edge emission casts h.row (u32 BindSpace row id) to u8 for CausalEdge64::pack, which wraps for row IDs above 255. In larger BindSpaces this silently aliases many distinct rows to the same edge indices, corrupting emitted edge provenance and downstream retrieval based on those packed indices.

Useful? React with 👍 / 👎.

AdaWorldAPI pushed a commit that referenced this pull request Apr 19, 2026
Adds four append-only bookkeeping files that work as a self-organizing
kanban / audit log so nothing falls through the cracks between
sessions.

Files:

1. EPIPHANIES.md — date-prefixed insight log. Reverse chronological.
   Every "aha" gets a YYYY-MM-DD entry with Status (FINDING /
   CONJECTURE / SUPERSEDED). Seeded with the 12 most recent
   epiphanies from this session; prior-art files (linguistic-
   epiphanies, cross-repo-harvest, integration-plan, session-
   capstone) cross-referenced as historical substrate.

2. ISSUES.md — bugs / regressions / invariant violations. Double-
   entry: Open Issues section + Resolved Issues section. Status
   transitions flip in place (Open row stays for chronology);
   Resolution line appends on close.

3. IDEAS.md — architectural speculation. Triple-entry: Open Ideas
   + Implemented Ideas + Integration Plan Update Log + Rejected/
   Deferred. Each shipped idea gets an audit trail from
   speculation -> code -> plan consequence.

4. TECH_DEBT.md — knowingly-deferred work (shortcuts, stubs,
   missing probes, hardcoded thresholds). Double-entry: Open Debt
   + Paid Debt. Seeded with 5 concrete debts from PRs #204-#211
   (ContextChain non-Binary16K coherence, CausalityFlow 3/9 slots,
   NER gap, FP_WORDS=160 migration, Abduction threshold calibration).

## Kanban discipline

Every entry in ISSUES / IDEAS / TECH_DEBT carries:
- Priority: P0 blocker / P1 high / P2 medium / P3 low.
- Scope: @<agent-name>, D<N> plan-id, domain:<tag>.

Agents filter by their own @-mention. Nothing gets buried because
every ticket has an owner named.

## Permission semantics flip (ask on Write, not Edit)

permissions.ask in .claude/settings.json now gates Write (full
overwrite) instead of Edit. Method hierarchy documented across
BOOT.md, concepts.md, SKILL.md:

1. APPEND (preferred) — new dated row via Edit-prepend or
   Bash cat >>. No prompt. Double-bookkeeping.
2. Edit field with prior Read — Status flip, Confidence update.
   No prompt. Prior Read is workspace discipline.
3. Write (full overwrite) — prompts for approval. Escape hatch.

Rule: when in doubt, APPEND.

All 8 bookkeeping files now follow the same rule:
PR_ARC_INVENTORY, LATEST_STATE, STATUS_BOARD, INTEGRATION_PLANS,
EPIPHANIES, ISSUES, IDEAS, TECH_DEBT.

BOOT.md + CLAUDE.md + cca2a/SKILL.md + cca2a/concepts.md all
updated with the unified 8-file table + method hierarchy +
kanban fields.
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