Skip to content

(SPARQL) Full W3C Suite in CI w/ Registers for Skip/Ignore - #1437

Merged
aaj3f merged 15 commits into
mainfrom
test/sparql-testsuite-full-coverage
Jul 8, 2026
Merged

aaj3f merged 15 commits into
mainfrom
test/sparql-testsuite-full-coverage

Conversation

@aaj3f

@aaj3f aaj3f commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR makes the entire W3C SPARQL test suite (the rdf-tests submodule, ~1,420 tests) an enforced, durable CI gate, and carries the complete, adversarially-verified burn-down plan for the remaining gaps. Before this change, the testsuite-sparql CI job ran cargo test --no-run — it compiled the harness but never executed a single test — and every evaluation category was #[ignore]d.

Now cargo test in testsuite-sparql/ runs all 36 suites green in ~15s, and CI runs exactly that on every PR. Every test either passes or appears in an explicit, root-cause-grouped skip register that is policed in both directions: an unregistered failure fails CI, and a registered test that starts passing also fails CI (stale entry). Registers can only shrink.

This PR contains zero engine changes — only the out-of-workspace testsuite-sparql crate, CI config, and docs. Hot-path risk is nil by construction. The engine fixes themselves live on 14 follow-up branches (see "What follows this PR").

Reviewer's guide — where to spend attention

Review carefully (the real surface, ~1.5k lines):

  • testsuite-sparql/src/ — harness changes: mf:UpdateEvaluationTest implemented end-to-end over the public sparql_update transact surface; named graphs loaded as real named graphs (TriG via the transact builder); CSV/TSV expected-result comparison; .rdf/SRX result-parser fixes; the both-way register policing in lib.rs::check_testsuite (unexpected-pass detection, zero-test floor, infra-death rule, dead-entry detection).
  • testsuite-sparql/tests/registers/mod.rs — the skip registers. Each entry carries a root-cause comment and the future PR that owns it.
  • .github/workflows/ci.yml — the compile-only step replaced with the real run.

Skim (analysis artifacts, ~6k lines): docs/audit/2026-07-sparql-testsuite-audit.md (taxonomy + perf discipline) and docs/audit/burn-down/ (nine per-cluster root-cause audits + ROADMAP.md, the verified implementation plan: PR slate, sequencing, decision register D-1..D-13, wave outcome records). These documents were produced under a two-stage process — parallel deep audits followed by adversarial verification that refuted 13 of 55 load-bearing claims before anything was implemented; §1.1 of the ROADMAP records every refutation.

Notable content decisions

  • Skip-register policy: entries are debt with a named owner, not permanent waivers — except the deliberately-permanent classes (protocol/HTTP suites = not applicable to an embedded engine; entailment regimes = documented non-goal, with the simple-entailment-answerable subset pinned green).
  • Decision register D-1..D-12 adopted (ROADMAP §4) with a standing rule: any follow-up PR actioning a decision must present the options and rationale in its description.
  • CI tests the merge commit, so the registers track main: when [FIX] SPARQL Parsing of sub-SELECT as a Set-Operation Operand #1436 (sub-SELECT set-op fix) landed mid-effort, the stale-entry gate caught the four affected tests and the re-baseline commit documents exactly what moved — that mechanism working is the point of this PR.

Fallout already handled on follow-up branches (not in this PR)

The suite immediately surfaced 10 production bugs, filed as #1438–#1447 with verified mechanisms (multi-op UPDATE silent data loss, FILTER(true) dropping all rows, DATATYPE() rejecting expressions, GRAPH ?g binding literals and leaking the default graph, a Turtle lexer rejection of valid _:label., non-canonical xsd:double output, and more). Eight of the ten are already fixed on the follow-up branches below.

What follows this PR

14 implementation branches (Waves 0–2 of the roadmap, ~230 register entries removed, all suite-green, all bench-gated) stack on this branch and become PRs after it merges, in the documented order: pr-h1 first (register hygiene), then siblings (pr-1, pr-l1, pr-l2, pr-x1, pr-pp, pr-2, pr-3, pr-u1, pr-base, pr-g1, pr-w15), then the two stacked pairs (pr-w2a after pr-1; pr-u2 after pr-3). Merge choreography, joint-entry rules, and the Wave-3+ plan are in docs/audit/burn-down/ROADMAP.md.

Test plan

  • cd testsuite-sparql && cargo test — 36 suites, 0 failed, 0 ignored (~15 s).
  • cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings clean.
  • CI job runs the full suite with a 45-minute timeout backstop (actual runtime is minutes, dominated by build).
  • No workspace crates touched.

aaj3f added 2 commits July 6, 2026 13:26
Audit found CI compiled the testsuite but never ran it, eval categories were
all #[ignore]d, and the harness had fallen behind the engine (UPDATE
execution, TriG/named graphs). This makes the whole rdf-tests submodule
enforceable:

- implement mf:UpdateEvaluationTest end-to-end over the public sparql_update
  transact surface (load ut:data/ut:graphData, apply, compare resulting
  default + named graph state isomorphically; 24 -> 67 passing)
- load qt:graphData/ut:graphData as real named graphs (TriG GRAPH blocks via
  the transact builder) instead of dumping them into the default graph; fix
  labeled graphData blank nodes being silently dropped (never read ut:graph)
- add CSV/TSV expected-result parsing with CSV-space projection (0 -> 5 of 6)
- register the SPARQL 1.2 suites (254 tests) and the un-versioned
  Positive/NegativeUpdateSyntaxTest types used by them
- move every suite's skip list to tests/registers/mod.rs, grouped by root
  cause; drop 14 stale property-path entries (13 features since landed +
  pp06 caught by the new check)
- police registers in both directions in check_testsuite: unexpected
  failures AND stale entries (registered tests that now pass) fail the suite
- drop the duplicate combined-manifest test fns; de-#[ignore] everything;
  CI now runs cargo test (36 suites, ~1420 tests, all green, ~15s wall)
- document the audit, failure taxonomy, and perf-safe burn-down plan in
  docs/audit/2026-07-sparql-testsuite-audit.md; refresh
  docs/contributing/sparql-compliance.md and the Makefile for the new model
… plan

Corrects the empirical placeholder: RDF 1.2 annotation syntax ({| |}, ~,
<<( )>> restricted to rdf:reifies) is parsed, lowered to
Pattern::EdgeAnnotation, executed, and durably stored via the reified-edge
model. Actual 1.2 gaps: triple-term functions, bare triple-terms-as-values
(design decision needed), Turtle-star ingest (map onto the existing
edge_annotations reifier pipeline), CONSTRUCT annotation projection. Also
records SERVICE as Fluree-only by design and confirms UPDATE Modify parses
WITH/USING.
@aaj3f
aaj3f requested review from bplatz and zonotope July 6, 2026 17:41
aaj3f added 6 commits July 6, 2026 13:58
SPARQL, JSON-LD query, and Cypher share the IR and execution engine. Every
W3C burn-down fix must classify as IR/engine-level (implicit parity, still
add a JSON-LD regression test) or surface-syntax addition (SPARQL-possible
=> JSON-LD-possible in the same effort; Cypher assessed against the
openCypher support matrix). The W3C submodule only guards the SPARQL
surface — JSON-LD/Cypher regression tests are authored with each fix.
We own the JSON-LD query syntax, so SPARQL-possible => JSON-LD-possible
stands with regression tests per fix. Cypher is openCypher — not our
grammar to extend — so SPARQL compliance work carries no Cypher syntax
obligations; it benefits from shared IR/engine fixes automatically.
Address the review's findings — all verified real; all make the harness's
green trustworthy rather than changing what it covers:

- (review #1) the 'no unexpected named graph' guard was dead code: the
  engine binds GRAPH ?g as a plain literal, so the Iri-only filter in
  list_named_graphs always produced []. Accept literal and IRI bindings
  (excluding the alias-named default graph) so the guard survives the
  eventual engine fix. Verified live: an update leaving a stray graph with
  no expected graphs now fails with 'Unexpected non-empty named graph'.
- (review #2) bail when a manifest yields zero tests — a submodule
  restructure or manifest-parser regression must not report green.
- (review #3) a registered test that dies by timeout/subprocess crash now
  hard-fails: the register excuses a known wrong answer, not an infra
  death masking a new hang or panic.
- (review #4) UpdateEvaluationTest now rejects an mf:result blank node
  exposing none of ut:data/ut:graphData/ut:result, instead of degrading to
  a trivially satisfiable 'expected empty store'.
- (review #5) register entries matching no discovered test now fail the
  suite, so dead entries (typos, upstream renames) cannot accumulate.
- notes: tightened the TSV bare-integer heuristic to a single optional
  leading sign; documented the line-based directive-hoisting assumption;
  fixed the stale 'CI runs make ci' Makefile comment.

Full suite remains green: 36 suites, ~1420 tests, 0 failed, 0 ignored.
…rables)

Pre-implementation root-cause audits for every register cluster, produced by
parallel deep-dive passes with live reproduction (run-w3c-test probes, CLI
repros) rather than register-comment inference. Highlights:

- update: ~90 failures collapse to 6 root causes; multi-operation ';'
  requests silently execute only the first op (production-facing; register
  comments for insert-05a / same-bnode / delete-insert-01c corrected)
- parser-syntax: 62 tests -> 8 accept-more + 6 reject-more rules; four
  validation passes missing entirely; reject-more = user-visible changes
- named-graph/dataset: GRAPH ?g literal binding is a one-line fix; default
  graph enumeration is the intentional #1279 extension (recommend
  W3C-by-default); SS5.3 answered: within-ledger datasets (Option A)
- expression-semantics: 13 defects; two shallow bugs (DATATYPE/LANG reject
  expression args; variable-free FILTER drops all rows) explain ~40 tests;
  ~28 register entries reassigned to other clusters
- lexer/formatter: bnode-label dot lexing + canonical xsd:double form
- sparql12 wave 1: VERSION already supported (register mislabel);
  lang-basedir is a cross-stack representation gap; Turtle-star ingest via
  shared EdgeKey::to_reifies_facts greens only 2/41 eval tests alone
- sparql12 wave 2: both triple-term registers are pure syntax suites; D3
  decision narrowed to accept-then-defer vs documented divergence
- residual-eval: property-path multiplicity framing corrected (sequences
  already correct + regression-guarded); pp34/35 are mis-filed graph bugs;
  entailment candidate wins via existing owl2rl materializer + PRAGMA

Stage-2 adversarial verification runs before any claim alters registers or
published statements.
Stage-2 verification of the eight cluster audits: 55 load-bearing claims
attacked by independent skeptics — 40 confirmed, 13 refuted, 2 uncertain —
plus a cross-cluster completeness check over every register entry.

Material corrections the verification caught before implementation:
- the proposed bnode-dot lexer loop breaks spec-valid _:a..b (and doesn't
  compile); replaced with greedy-scan + trailing-dot-rewind
- the harness .rdf DAWG parser bug is real but backwards: Event::Empty
  state-stack skew keeps unbound solutions and DROPS bound ones
- double canonicalization scope was missing export.rs N-Triples/N-Quads
  sites and R2RML lexical() consumers
- named-graph BUG-4 (existence-row drop) is empirically false — graph-exist
  actually fails on base-relative IRI resolution; phantom PR deleted and
  replaced with PR-BASE, which fills a genuine ownership vacuum
- fluree-db-api swallows parse-error diagnostics whenever an AST survives
  recovery, so grammar tightening must prevent AST production
- EdgeKey::to_reifies_facts full variant would emit orphan flakes; ingest
  must use the _jsonld_compatible variant, guarded by equivalence tests

Slate: 17 firm PRs + 5 decision-gated items + 2 unowned work-streams
(algebra/OPTIONAL-scope and output-serialization need a ninth cluster
audit). Firm slate removes ~418 of 538 registered entries; end state with
all decisions favorable is ~124 remaining (63 not-applicable, 47
entailment, 14 orphans). Decisions D-1..D-12 enumerated for team sign-off;
three production bugs queued for immediate issue filing.
aaj3f added 6 commits July 6, 2026 23:02
…1436)

CI runs the PR merge commit, and #1436 landed on main after this branch's
baseline: test_21/test_23/test_64 (sub-SELECT placement positives) and
subquery12 now pass — removed per the both-way stale-entry policing that
flagged them. test_65 (syntax-SELECTscope2) now parses instead of failing
for the wrong reason, so it moves to the accepts-invalid class awaiting the
SELECT-scope validation pass (burn-down PR-2).
…tion orphans

The 14 unowned register entries decompose into six defects, with five
corrections to prior assumptions: W-1's fix territory is parser/lowerer +
subquery.rs + optional.rs, NOT where_plan.rs filter partitioning (the
land-PR-X1-first gate is void; verified disjoint against the pr-x1 diff);
quotes-3/4 are pattern-object datatype-drop (PR-X2 D5b), not string
escaping; all three optional-complex tests are GRAPH-gated (PR-G1), not
just complex-2; construct-3/4 + constructlist fall to ONE generic
per-solution bnode-instantiation fix in CONSTRUCT output; nested-opt-1/2
need independent-scope-then-leftjoin OPTIONAL semantics — the one
hot-path-risky item, split into its own deferrable PR.
Comment thread testsuite-sparql/src/query_handler.rs Resolved
Comment thread testsuite-sparql/src/query_handler.rs Resolved

@bplatz bplatz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments on this one, great to have additional coverage!

Address bplatz's two inline comments on the update-eval harness. Both make
the suite's "green" more trustworthy; neither touches the engine.

- (comment 2) list_named_graphs no longer excludes the default graph by
  string-comparing the ledger alias. The engine leaks the default graph into
  GRAPH ?g under the alias (burn-down/named-graph-dataset.md BUG-2 / #1279);
  step 5 now recognizes that leak by CONTENT (its triples equal the
  default-graph readback), which survives the engine renaming or IRI-expanding
  the alias, and emits a diagnostic if the default graph ever surfaces under an
  unexpected name. Dropping the name filter routes the leaked graph through the
  content check on every default-graph update test, so the full suite staying
  green proves the recognition works.

- (comment 1) Document the register's structural blind spot: the both-way
  check catches registered-pass (stale) and unregistered-fail (regression) but
  is blind to an unregistered false-pass. Two leniencies open it — empty-graph
  non-tracking (CLEAR/DROP/CREATE, all currently registered; must not be
  silently un-registered when the graph-management grammar lands) and net-zero
  update vacuity. Enumerated the 12 currently-passing net-zero update-eval
  tests (rdflib isomorphism of initial vs expected state, intersected with the
  live pass list) in audit sec 5.4; flagged the WITH/USING no-op cases whose
  broken siblings are already registered.

Full suite: 36 suites, 0 failed, 0 ignored-as-error. cargo fmt/clippy clean.
@aaj3f
aaj3f merged commit cb8abe2 into main Jul 8, 2026
13 checks passed
@aaj3f
aaj3f deleted the test/sparql-testsuite-full-coverage branch July 8, 2026 04:10
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