Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .claude/board/AGENT_LOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 2026-09-22 — SAP/CATS fold-first dependency stack (PR #1257, unmerged)

- Substrate: ndarray #318 `d0376505`; lance-graph #1256 `4d27032e`.
#1246 and #1247 are already ancestors. SAP CI pins the ndarray commit.
- `CatsQuery` lowers one `Agg::GroupSumI32` through Quack. Bounded tile
scratch remains; no population bitmap is retained by binding or aggregation.
`select_into` requests a bitmap only for the terminal BAPI assignment sink.
- Removed the unused all-ones alpha allocation. Positive hours are checked
at binding so every subset/group fits I64 despite the kernel's wrapping sum.
- A rotation changes coordinate-to-ordinal references; it does not transpose
carrier storage. The existing BAPI ordinal permutation is an edge read map.
- SAP tests pass across 0/1/63/64/65/131/4097 inputs, against independent
arithmetic and the substrate reference interpreter; repeat resets, bounded
scratch, zero hot allocations and original-assignment boundary selection.
Strict SAP clippy passes. No nanosecond performance claim is made.
- Inventory: isolated `lance-graph-sap` consumer contains source descriptors,
`CatsSchema: ClassView`, column binding to existing `LaneRef`, cold codebooks,
Quack orchestration and explicit C#/hash/BAPI sinks. No SAP execution engine.

## 2026-09-14 (5) — the ceiling guard CodeRabbit found on the fold commit, and a falsifier that tracked its own constant

**The finding, against `061d12b` (post-fold, not the reviewed `687042f`).**
Expand Down
19 changes: 19 additions & 0 deletions .claude/board/LATEST_STATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 2026-09-22 — SAP/CATS fold-first dependency stack (PR #1257, unmerged)

- Substrate: ndarray #318 `d0376505`; lance-graph #1256 `4d27032e`.
#1246 and #1247 are already ancestors. SAP CI pins the ndarray commit.
- `CatsQuery` lowers one `Agg::GroupSumI32` through Quack. Bounded tile
scratch remains; no population bitmap is retained by binding or aggregation.
`select_into` requests a bitmap only for the terminal BAPI assignment sink.
- Removed the unused all-ones alpha allocation. Positive hours are checked
at binding so every subset/group fits I64 despite the kernel's wrapping sum.
- A rotation changes coordinate-to-ordinal references; it does not transpose
carrier storage. The existing BAPI ordinal permutation is an edge read map.
- SAP tests pass across 0/1/63/64/65/131/4097 inputs, against independent
arithmetic and the substrate reference interpreter; repeat resets, bounded
scratch, zero hot allocations and original-assignment boundary selection.
Strict SAP clippy passes. No nanosecond performance claim is made.
- Inventory: isolated `lance-graph-sap` consumer contains source descriptors,
`CatsSchema: ClassView`, column binding to existing `LaneRef`, cold codebooks,
Quack orchestration and explicit C#/hash/BAPI sinks. No SAP execution engine.

## 2026-09-19 (3) — PR #1252 merged (`8545a555`); `main` is `8545a555`

- **Docs only, no contract inventory delta.** Ruling now on `main`: *we think
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 2026-09-22 — E-CATS-FOLD-DOES-NOT-RETAIN-A-POPULATION-BITMAP-1 — CATS aggregate lowers to one tiled grouped terminal; bitmap realization is a requested boundary sink

## 2026-09-22 — SAP/CATS fold-first dependency stack (PR #1257, unmerged)

- Substrate: ndarray #318 `d0376505`; lance-graph #1256 `4d27032e`.
#1246 and #1247 are already ancestors. SAP CI pins the ndarray commit.
- `CatsQuery` lowers one `Agg::GroupSumI32` through Quack. Bounded tile
scratch remains; no population bitmap is retained by binding or aggregation.
`select_into` requests a bitmap only for the terminal BAPI assignment sink.
- Removed the unused all-ones alpha allocation. Positive hours are checked
at binding so every subset/group fits I64 despite the kernel's wrapping sum.
- A rotation changes coordinate-to-ordinal references; it does not transpose
carrier storage. The existing BAPI ordinal permutation is an edge read map.
- SAP tests pass across 0/1/63/64/65/131/4097 inputs, against independent
arithmetic and the substrate reference interpreter; repeat resets, bounded
scratch, zero hot allocations and original-assignment boundary selection.
Strict SAP clippy passes. No nanosecond performance claim is made.
- Inventory: isolated `lance-graph-sap` consumer contains source descriptors,
`CatsSchema: ClassView`, column binding to existing `LaneRef`, cold codebooks,
Quack orchestration and explicit C#/hash/BAPI sinks. No SAP execution engine.

3 changes: 2 additions & 1 deletion .claude/board/entries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ 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.

144 entries, 2026-08-06 .. 2026-08-31.
145 entries, 2026-08-06 .. 2026-09-22.

| date | entry id | finding | file |
|---|---|---|---|
| 2026-09-22 | `E-CATS-FOLD-DOES-NOT-RETAIN-A-POPULATION-BITMAP-1` | CATS aggregate lowers to one tiled grouped terminal; bitmap realization is a requested boundary sink | [2026-09-22-e-cats-fold-does-not-retain-a-population-bitmap-1.md](2026-09-22-e-cats-fold-does-not-retain-a-population-bitmap-1.md) |
| 2026-08-31 | `E-Q8-THE-SIX-DOES-NO-WORK-A-DEGREE-ABLATION-COLLAPSES-THE-HEX-OVERLAYS-ENTIRE-ADVANTAGE-1` | B passes every pre-registered gate and the pass is unattributable: at degree 1 it scores identically with 5.5× less memory | [2026-08-31-e-q8-the-six-does-no-work-a-degree-ablation-collapses-the-hex-overlays-entire-advantage-1.md](2026-08-31-e-q8-the-six-does-no-work-a-degree-ablation-collapses-the-hex-overlays-entire-advantage-1.md) |
| 2026-08-27 | `E-THE-FUSED-PAYLOAD-IS-INERT-AT-EVERY-EXECUTION-GATE-THAT-CONSUMES-IT-1` | | [2026-08-27-e-the-fused-payload-is-inert-at-every-execution-gate-that-consumes-it-1.md](2026-08-27-e-the-fused-payload-is-inert-at-every-execution-gate-that-consumes-it-1.md) |
| 2026-08-26 | `E-THE-PERTURBATION-FIELD-NEVER-REACHED-THE-MASK-ALU-1` | the three DTOs are an adapter seam, not an ALU chain: PerturbationDto.energy is dropped, top_k collapses to a min/max window, and the p64 mask ALU is DTO-blind; 4096==4096 is not an address identity (S/4×O/4 vs codebook) — probe gate filed | [2026-08-26-e-the-perturbation-field-never-reached-the-mask-alu-1.md](2026-08-26-e-the-perturbation-field-never-reached-the-mask-alu-1.md) |
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/sap-cats-abi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: SAP CATS ABI
on:
pull_request:
paths:
- 'crates/lance-graph-sap/**'
- 'crates/lance-graph-quack/**'
- 'crates/lance-graph-mask-risc/**'
- 'crates/lance-graph-contract/**'
- '.github/workflows/sap-cats-abi.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
cats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: lance-graph
persist-credentials: false
- uses: actions/checkout@v4
with:
repository: AdaWorldAPI/ndarray
ref: master
path: ndarray
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Record tested substrate
run: git -C ndarray rev-parse HEAD
- name: Format
run: cargo +stable fmt --manifest-path lance-graph/crates/lance-graph-sap/Cargo.toml -- --check
- name: Lint
run: cargo +stable clippy --manifest-path lance-graph/crates/lance-graph-sap/Cargo.toml --all-targets -- -D warnings
- name: ABI and boundary tests
run: cargo +stable test --manifest-path lance-graph/crates/lance-graph-sap/Cargo.toml
- name: Executable CATS slice
run: cargo +stable run --manifest-path lance-graph/crates/lance-graph-sap/Cargo.toml --example cats
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"crates/lance-graph-hydrate",
]
exclude = [
"crates/lance-graph-sap",
# Python bindings (upstream-inherited, opt-in via --manifest-path)
"crates/lance-graph-python",
"crates/lance-graph-codec-research",
Expand Down
3 changes: 3 additions & 0 deletions crates/lance-graph-sap/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target/
/tools/csharp/bin/
/tools/csharp/obj/
15 changes: 15 additions & 0 deletions crates/lance-graph-sap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "lance-graph-sap"
version = "0.1.0"
edition = "2021"
publish = false
description = "Source-pinned CATS boundary adapters over ClassView and Quack"

[workspace]

[dependencies]
lance-graph-contract = { path = "../lance-graph-contract" }
lance-graph-mask-risc = { path = "../lance-graph-mask-risc" }
lance-graph-quack = { path = "../lance-graph-quack" }
hmac = "0.12"
sha2 = "0.10"
40 changes: 40 additions & 0 deletions crates/lance-graph-sap/examples/cats.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//! Run: cargo run --manifest-path crates/lance-graph-sap/Cargo.toml --example cats
use lance_graph_sap::{bind::CatsBatch, edge::*, query::CatsQuery, schema::CatsSchema};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let fields: Vec<_> = include_str!("../fixtures/cats.txt")
.lines()
.map(|s| if s == "\\N" { None } else { Some(s) })
.collect();
let mut input: [Vec<_>; 23] = std::array::from_fn(|i| vec![fields[i]; 4]);
input[5][3] = Some("00000007");
input[11][2] = Some("OPS");
input[10][2] = Some("0.125");
input[20] = vec![Some("123456789012345678901234567890123456789012345678901234567890"); 4];
let batch = CatsBatch::bind(
CatsSchema::new(42, 0),
std::array::from_fn(|i| input[i].as_slice()),
)?;
let mut query = CatsQuery::prepare(&batch, "00000042", "2026-09-01", "2026-09-30")?;
let mut sums = vec![0; query.groups()];
query
.execute_into(&mut sums)
.map_err(|e| format!("execution: {e:?}"))?;
let mut kept = vec![0; batch.len().div_ceil(64)];
query
.select_into(&mut kept)
.map_err(|e| format!("selection: {e:?}"))?;
println!("Exact scale: {}", batch.scale());
for total in activity_totals(&batch, &sums)? {
println!("{} = {} hours", total.activity_type, total.hours);
}
let records = bapi_sink(&batch, &kept)?;
println!(
"{}: {} selected original assignments",
BAPI_FUNCTION,
records.len()
);
for record in records {
println!("{record:?}");
}
Ok(())
}
21 changes: 21 additions & 0 deletions crates/lance-graph-sap/examples/oracle.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use lance_graph_sap::{bind::CatsBatch, edge::*, schema::CatsSchema};
fn main() {
let values: Vec<_> = include_str!("../fixtures/cats.txt")
.lines()
.map(|v| if v == "\\N" { None } else { Some(v) })
.collect();
let columns: [_; 23] = std::array::from_fn(|i| [values[i]]);
let batch = CatsBatch::bind(
CatsSchema::new(42, 0),
std::array::from_fn(|i| columns[i].as_slice()),
)
.unwrap();
for value in csharp_fields(&batch, 0).unwrap() {
println!("{}", value.as_deref().unwrap_or("\\N"));
}
let projection = ordered_hash_projection(&batch, 0, HashProfile::SmbMiddleware).unwrap();
println!(
"{projection}\n{}",
hash_projection(&projection, b"fixture-key")
);
}
23 changes: 23 additions & 0 deletions crates/lance-graph-sap/fixtures/cats.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
entry-1
SAP
BillableHours
100
2026-09-01T12:34:56Z
00000042
0000000123
WBS-1
000000000123
2026-09-01T00:00:00Z
8.50
DEV
Billable
2026-09-01T00:00:00Z
2026-09-01T02:00:00+02:00
Valid
\N
true
fixture-hash
GDPR
fixture note
\N
\N
Loading
Loading