Skip to content

contract + mask-risc: resolve read-mode once per population; 16-byte facet match predicate - #1326

Merged
AdaWorldAPI merged 5 commits into
mainfrom
ccr-f6094d67-h6ulb3
Oct 4, 2026
Merged

AdaWorldAPI merged 5 commits into
mainfrom
ccr-f6094d67-h6ulb3

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Follows #1322. Metadata is resolved once per population, and the row loops do no read-mode lookup. Also exposes the 16-byte strided matcher from AdaWorldAPI/ndarray#340 (merged) as a mask-risc predicate.

Changes

  • soa_graph: project_snapshot and nearest_anchor resolve the domain's TailVariant once (domain_tail) and pass it to hhtl_path / family_of / identity_of. Before, each helper looked up classid_read_mode for every row.
  • nan_projection: adds project_energy_nonfinite_resolved(rows, ValueSchema) and energy_all_finite_resolved(rows, ValueSchema).
    • They take the population's already-resolved schema (e.g. ResolvedReading::read_mode.value_schema) and do no lookup.
    • The mixed-batch API now resolves once per run of equal classid and delegates to them. Its remaining per-row cost is one classid compare.
    • The schema gate and the exponent-mask test are unchanged.
  • lance-graph-mask-risc: adds Pred::MatchFacet16Strided {lane, pattern: [u8; 16], care: [u8; 16]}, lowered to ndarray::simd::ternary_match_strided16_to_mask.
    • Validation requires the view to be 16 bytes wide, and the oracle compares all 16 bytes.
    • No new IR shape; Quack is unchanged.
  • Test-only lookup counter in classid_read_mode (#[cfg(test)] thread-local).
  • Board: D-HPS-2 entry, LATEST_STATE, entries index, supersession index.

Falsifiers

  • The lookup count is the same for 1 and 1000 rows: 1 per call in soa_graph, 1 for the mixed wrapper on a homogeneous batch, 0 on the resolved path.
  • Disable runs, each red then restored:
    • per-row lookup put back in hhtl_path;
    • per-row lookup added in the resolved loop;
    • schema gate dropped in the resolved path;
    • mixed wrapper cut to runs of length 1.
  • MatchFacet16Strided is checked against the oracle and an independent byte count:
    • partial care spanning both halves;
    • care on byte 15 only, which must actually filter rows;
    • all-wildcard care matches every row;
    • a gated match;
    • a view 4 bytes short is refused, while the 12-byte predicate accepts the same view.
  • MatchFacet16Strided disable runs, all red: executor on the 12-byte kernel; oracle comparing 12 bytes; width check at 12.

Measured

Release build, target-cpu=native, 100k homogeneous rows:

path ns/row
per-row lookup (old shape) 23.7–24.6
resolved 5.0
mixed wrapper 10.0–10.3

12-byte vs 16-byte matcher, stride 512, 65,536 rows: 5.1–5.3 ns/row for both. soa_graph was not timed.

Not in this PR

  • Bake paths: q2 fma.rs per-node lookup and deepnsm-v2 key_at. Both left OPEN.
  • symbiont domino.rs: its boards all have classid 0, so the mixed wrapper already costs one lookup.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PWtMb9jQ4gof5g4y2jzNt

claude added 2 commits October 4, 2026 21:28
…projection

soa_graph resolves the domain's TailVariant once per project_snapshot /
nearest_anchor call instead of per row. nan_projection gains resolved
entry points (project_energy_nonfinite_resolved, energy_all_finite_resolved)
taking the population's ValueSchema; the mixed-batch API now resolves once
per run of equal classid and delegates to them.

A test-only lookup counter in classid_read_mode pins both: lookup count is
independent of row count (1 vs 1000 rows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PWtMb9jQ4gof5g4y2jzNt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PWtMb9jQ4gof5g4y2jzNt
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 52 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: b6a24148-b2cb-421a-bb3c-af9902da44b5
📥 Commits

Reviewing files that changed from the base of the PR and between 84e64eb and 70389c2.

📒 Files selected for processing (10)
  • .claude/board/LATEST_STATE.md
  • .claude/board/entries/2026-10-04-resolve-once-population-execution.md
  • .claude/board/entries/README.md
  • crates/lance-graph-contract/src/canonical_node.rs
  • crates/lance-graph-contract/src/nan_projection.rs
  • crates/lance-graph-contract/src/soa_graph.rs
  • crates/lance-graph-mask-risc/src/exec.rs
  • crates/lance-graph-mask-risc/src/ir.rs
  • crates/lance-graph-mask-risc/src/reference.rs
  • crates/lance-graph-mask-risc/tests/strided.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Oct 4, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 1a9fb0c4-999c-440b-a892-9f03b0eb4181)

claude added 2 commits October 4, 2026 22:00
…atcher

The 16-byte ternary match of a strided field, lowered to
ndarray::simd::ternary_match_strided16_to_mask (ndarray #340). Validation
checks the view is 16 bytes wide; the oracle compares all 16 bytes.
No new IR shape; Quack is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PWtMb9jQ4gof5g4y2jzNt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PWtMb9jQ4gof5g4y2jzNt
@AdaWorldAPI AdaWorldAPI changed the title contract: resolve read-mode once per population (soa_graph, nan_projection) contract + mask-risc: resolve read-mode once per population; 16-byte facet match predicate Oct 4, 2026
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 4, 2026 22:07
Board conflicts only: LATEST_STATE keeps both 2026-10-04 sections; the
entries index is regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PWtMb9jQ4gof5g4y2jzNt
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