Skip to content

test(v3): cross-ciphertext equality via per-type doubles fixtures (CIP-3141)#303

Merged
tobyhede merged 8 commits into
eql_v3from
v3-property-cross-ciphertext
Jun 20, 2026
Merged

test(v3): cross-ciphertext equality via per-type doubles fixtures (CIP-3141)#303
tobyhede merged 8 commits into
eql_v3from
v3-property-cross-ciphertext

Conversation

@tobyhede

Copy link
Copy Markdown
Contributor

Stacked on #293 (function-double oracles). Merge #293 first.

What

Proves "two independent encryptions of one value compare equal" for every comparison-capable eql_v3 scalar, credential-free in the fixture suite — not only in the creds-gated e2e suite.

The matrix's curated fixtures have unique plaintexts (the scalars::* matrix asserts the table equals fixture_values() exactly), so they can only exercise equality-true on self-pairs (same ciphertext). To cover equality across distinct ciphertexts without fresh test-time encryption, each comparison type gets a tiny sibling table fixtures.eql_v2_<T>_doubles — the first three catalog values, each encrypted twice — read ONLY by the new property::cross_ciphertext test. The matrix and its curated fixtures are untouched.

Covers both equality mechanisms for all 7 types (int2/int4/int8/date/timestamptz/numeric/text):

  • hm/HMAC via the _eq domain (assert_eq_oracle),
  • ORE ob via the _ord / _ord_ore domains, where = routes through compare_ore_block_256_terms(...) = 0 (a structural guarantee — the Lewi-Wu comparator decides equality on deterministic PRP + LEFT bytes only).

Changes

  • fixtures/eql_doubles.rs — per-type non-catalog FixtureSpec generators (the v3_numeric_collision pattern, generalized), wired into fixture:generate:all.
  • fixture_oracle.rsembedded_doubles_sql / load_doubles_rows.
  • property/cross_ciphertext.rs — the focused test: distinct-ciphertext pair + =/<> through hm and both ORE domains, per type.
  • Docs: README, coverage analysis, and the test(sqlx): eql_v3 SQL-function property tests (CIP-3141) #293 CHANGELOG entry corrected (the fixture suite now covers cross-ciphertext too).

The generated eql_v2_<T>_doubles.sql fixtures are gitignored; CI regenerates them in test:sqlx:prep.

Testing

  • No-DB: macro tests + doubles unit test green.
  • DB-backed (matrix-green on curated fixtures + the 7 cross_ciphertext_* tests + fixture regen) run in CI.

@coderabbitai

coderabbitai Bot commented Jun 19, 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: 5f16f63d-7793-418e-b032-0032be32a578

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 v3-property-cross-ciphertext

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 v3-property-tests-fn-doubles branch from 65fe909 to 34d3e9e Compare June 19, 2026 13:16
@tobyhede tobyhede force-pushed the v3-property-cross-ciphertext branch from efddeb5 to c6366d7 Compare June 19, 2026 13:49
Base automatically changed from v3-property-tests-fn-doubles to eql_v3 June 20, 2026 01:29
tobyhede added 8 commits June 20, 2026 11:35
docs-static (source-only SQL doxygen coverage + required-tags) ran on
every PR, unlike the other heavy jobs. Its inputs are a strict subset of
the changes-job relevant filter — src/**, the crates/** codegen build it
depends on, and the tasks/docs/** validator scripts — so a PR that leaves
relevant false cannot change its outcome. Gate it on the same flag as the
other jobs: consistent, and drops a redundant codegen build on
markdown-only PRs without losing coverage. A narrower src/**-only filter
was rejected — it would risk a silent false-green (ci-required counts
skipped as pass) by skipping on a real input change.

Sync .github/workflows/README.md (coverage map, known gaps, recently-
closed, operator-setup verification) and the stale validate-job comment.
The cross-ciphertext oracle include_str!s eql_v2_<token>_doubles.sql at
compile time, but stub-fixtures.sh only stubbed eql_v2_<token>.sql and the
literal .gitignore *.sql entries — neither matches the _doubles glob. So the
no-creds matrix-coverage / inventory jobs could not compile the encrypted_domain
binary to --list it (rustc: couldn't read eql_v2_int4_doubles.sql, ...).

Stub eql_v2_<token>_doubles.sql alongside eql_v2_<token>.sql for every catalog
token, consistent with the helper's stub-the-complete-set policy (harmless
extras for storage-only tokens with no real doubles fixture).
@tobyhede tobyhede force-pushed the v3-property-cross-ciphertext branch from c6366d7 to e55f72d Compare June 20, 2026 03:13
@tobyhede tobyhede merged commit e9dd533 into eql_v3 Jun 20, 2026
18 checks passed
@tobyhede tobyhede deleted the v3-property-cross-ciphertext branch June 20, 2026 03:31
tobyhede added a commit that referenced this pull request Jun 20, 2026
test(v3): cross-ciphertext equality via per-type doubles fixtures (CIP-3141)
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