Skip to content

feat(test): spareval differential oracle — orchestration fully in Rust (#17)#59

Merged
styk-tv merged 1 commit into
mainfrom
feat-17-oracle-run
Jul 3, 2026
Merged

feat(test): spareval differential oracle — orchestration fully in Rust (#17)#59
styk-tv merged 1 commit into
mainfrom
feat-17-oracle-run

Conversation

@styk-tv

@styk-tv styk-tv commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What

Closes #17. Lands the differential oracle as the standalone pgrdf-oracle crate (tests/oracle/ — spareval + oxrdf, no pgrx linkage) with all harness orchestration in the binary: the prototype's bash per-fixture wiring was a spike and is fully eliminated (course-correction 2). tests/w3c-sparql/run.sh is now env-resolution + cargo build + one pgrdf-oracle run invocation.

The comparator/eval core (canonicalization, bag equivalence, blank-node isomorphism) and the 53 per-fixture markers carry over from the prototype handoff unchanged — credit to the prototype session; findings #54/#55 came from its first run.

Key properties

  • Differential always on (no ORACLE=1 opt-in): an eligible divergence fails the run. Known divergences are marker-tracked (32 → #54, 08 → #55) and non-fatal until adjudicated, with ORACLE-RESOLVED? staleness reporting if they start matching. The oracle also second-opinions every ACCEPT-regenerated golden — the exact blind spot spareval differential test harness (W3C oracle) #17 was opened to close.
  • Bash-parity proven: SQL assembly byte-identical; graph-id rule verified identical for all 53 fixtures; golden gate bag-equivalent (both sides sorted — fixture 35's on-disk golden predates the C-locale ACCEPT convention and caught the one-sided-sort bug during verification).
  • Engine access stays external (--engine-cmd: SQL on stdin → psql rows on stdout), so the crate builds anywhere; fixtures/ remains reserved for the official W3C rdf-tests suite (course-correction 1, follow-up).
  • ci.yml regression job gains a rust toolchain + cargo cache; the w3c step is now golden + differential in one blocking gate.

Verification

gate result
golden (isolated container, main-built .so) 53/53
differential oracle 37 match · 2 known-divergence · 0 diverge · 14 ineligible-skip
exit-code gating verified both directions
golden regression 100/100 (untouched)
crate tests 30 unit + 5 CLI
fmt + clippy -D warnings (crate) clean

New fixtures 52 (#51) and 53 (#50) are eligible and oracle-verified — the scoring-loop expression surface now sits under a standing second judge.

#17)

Lands the W3C SPARQL differential oracle as a standalone crate
(tests/oracle, pgrdf-oracle: spareval + oxrdf/oxttl/spargebra,
deliberately independent of the pgrx build) with ALL harness
orchestration in the binary — the bash per-fixture wiring from the
prototype was a spike and is fully eliminated per the issue's
course-correction 2. tests/w3c-sparql/run.sh is now env-resolution +
cargo build + ONE invocation of 'pgrdf-oracle run'.

The comparator/eval core (canonical JSONL row shapes, numeric-lexical
canonicalization, bag equivalence, blank-node isomorphism via
backtracking bijection) and the 53 per-fixture eligibility markers
carry over from the prototype handoff unchanged. New in this cut:

- 'pgrdf-oracle run' subcommand: fixture walk (data.ttl|setup.sql
  discovery, fixtures/ reserved for the official W3C rdf-tests suite,
  course-correction 1), byte-for-byte bash-parity SQL assembly
  (verified: identical graph ids for all 53 fixtures), engine
  execution via --engine-cmd (SQL on stdin -> psql rows on stdout, so
  the crate needs no Postgres linkage), golden gate (bag-equivalent:
  BOTH sides sorted — goldens on disk predate the C-locale ACCEPT
  convention; fixture 35 caught this), marker-driven differential
  pass, verdict reporting, exit-code gating.
- The differential is now ALWAYS ON (no ORACLE=1 opt-in): an eligible
  divergence fails the run; the two known divergences the prototype
  found on day one are marker-tracked (32 -> #54 CONSTRUCT set
  semantics, 08 -> #55 HAVING alias) and non-fatal until adjudicated,
  with ORACLE-RESOLVED? staleness reporting if they start matching.
  The oracle also second-opinions every ACCEPT-regenerated golden —
  closing the exact blind spot this issue was opened for.
- New fixtures 52/53 (expression surface #51, aggregates-over-
  expressions #50) marked eligible and oracle-verified.
- ci.yml regression job: rust toolchain + cargo cache for the oracle
  build; the w3c step is now golden + differential in one gate.

Verified against an isolated container (main-built .so): 53/53
golden, oracle 37 match / 2 known-divergence / 0 diverge / 14
ineligible-skip, exit codes correct both ways; regression 100/100
untouched; crate: 30 unit + 5 CLI tests, fmt + clippy -D warnings
clean.

Closes #17
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.

spareval differential test harness (W3C oracle)

1 participant