Skip to content

Matrix log verification — Stage 3: op-qualified index names (finding-1)#291

Open
tobyhede wants to merge 4 commits into
matrix-capture-stage2from
matrix-capture-stage3
Open

Matrix log verification — Stage 3: op-qualified index names (finding-1)#291
tobyhede wants to merge 4 commits into
matrix-capture-stage2from
matrix-capture-stage3

Conversation

@tobyhede

Copy link
Copy Markdown
Contributor

Summary

Stage 3 of the matrix log-verification work. Lifts the index-engagement fan-out so each (domain, op, using) is its own #[sqlx::test] named matrix_<T>_<domain>_index_engages_<op>_<using> (e.g. matrix_int4_ord_index_engages_lt_btree) instead of one per-(domain, using) test that swept the operator list inside a single body. Each operator now carries its own case_id, so the Stage 2 statement/plan log is joinable to a single (domain, operator) — closing the design's finding-1 naming gap that Stage 4's matcher depends on.

The driver refactor reworks the fan-out only; the Stage 2 leaf body (eqlmatrix::tag, executed count(*) under SET LOCAL enable_seqscan=off, assert_index_scan_uses) is reproduced verbatim minus the inner op loop. No other test category is renamed.

Stacked on matrix-capture-stage2 (PR #285). Will retarget to main when #285 merges.

Commits

  • op-qualify index-engagement test names (finding-1) — the macro split (__scalar_matrix_index_op_outer! + reshaped __scalar_matrix_index_case!)
  • regenerate name snapshotsmatrix_tests.txt + derived matrix_tests_eq_only.txt
  • regenerate cargo-expand snapshotint4_expanded.rs, diff confined to index arms

The Task 1 baseline refresh (82f3acb, which absorbs Stage 2's accumulated int4_expanded.rs drift) lands on PR #285, so this PR's snapshot diff stays confined to the index rename.

Test Plan

  • cargo test --test encrypted_domain --no-run — macros expand
  • Live DB: 12 op-qualified index tests pass (int4 eq/ord/ord_ore)
  • All scalar matrix suites: 1146 passed, 0 failed
  • mise run test:matrix:inventory — green (op-qualified matrix_tests.txt)
  • mise run test:matrix:catalog-coverage — green (domain prefixes intact)
  • int4_expanded.rs regen diff confined to index_engages arms; markers (eqlmatrix, enable_seqscan=off, assert_index_scan_uses) intact
  • Ledger parser verified name-agnostic (0 index-name literals in parser source)
  • CodeRabbit review: 0 findings

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 103a1225-e55d-4790-9f89-663d1a8488b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matrix-capture-stage3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@tobyhede tobyhede force-pushed the matrix-capture-stage2 branch from 82f3acb to 32bf768 Compare June 17, 2026 01:02
tobyhede added 4 commits June 17, 2026 13:18
Split the index-engagement fan-out so each (domain, op, using) is its own
one per-(domain,using) test that swept the op list internally. Each op now
carries its own case_id, so the Stage 2 statement/plan log is joinable to a
single (domain, operator) — closing the design's finding-1 naming gap. The
leaf body (eqlmatrix::tag, executed count(*) under enable_seqscan=off,
assert_index_scan_uses) is unchanged; only the fan-out and the test name move.
The index-engagement split (finding-1) renames matrix_<T>_<domain>_index_
engages_<using> to op-qualified matrix_<T>_<domain>_index_engages_<op>_<using>.
Regenerate the committed matrix_tests.txt set (one line per (domain,op,using))
and re-derive matrix_tests_eq_only.txt. Coordinated with the matrix-coverage
CI gate, which git-diff-exit-codes these snapshots.
… arms

The index-engagement op fan-out (finding-1) changes the macro bodies, so the
int4 cargo-expand body snapshot moves. Regenerated under the pinned nightly
(mise run test:matrix:expand). The diff is confined to the index_engages arms;
non-index arm bodies are unchanged, and the regenerated index arms still carry
the eqlmatrix tag, SET LOCAL enable_seqscan=off, and assert_index_scan_uses —
proof the Stage 2 leaf behaviour survived the driver refactor.
The finding-1 op-qualification (matrix_<T>_<domain>_index_engages_<op>_<using>)
was authored before the text scalar / eqidx-routed equality existed, so rebasing
it onto the text shape surfaced a naming divergence the old swept names hid:

- text serves eq on an ordered domain from a dedicated eq index, naming it
  `<domain>_eqidx_index_engages_eq_<using>`, where an ordered scalar whose ord
  index also serves eq names it `<domain>_index_engages_eq_<using>`.

Two coordinated changes:

- Regenerate snapshots/matrix_tests_text.txt to the op-qualified names (commit
  a967cd1's intent, which could not touch the text snapshot — text did not exist
  on the source branch).
- Make the text superset gate routing-agnostic: fold the `_eqidx` routing
  segment away before the superset `comm`, so the invariant compares
  (domain, op, index) COVERAGE rather than the physical index that serves it. A
  genuinely dropped eq arm (neither name present) still fails; the strict
  per-type compare still pins text's real `_eqidx` names byte-for-byte.

mise run test:matrix:inventory passes (6 types reconciled).
@tobyhede tobyhede force-pushed the matrix-capture-stage3 branch from 017c8bb to a2265f9 Compare June 17, 2026 04:08
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.

1 participant