test: hermetic W3C N3 reasoning spec test suite - #1961
Draft
jeswr wants to merge 2 commits into
Draft
Conversation
Adds a jest runner for the reasoning entries of the W3C N3 test suite (w3c/N3 tests/N3Tests/manifest-reasoner.ttl), run as a separate jest project so the coverage-thresholded unit suite is unaffected: - __tests__/spec/w3c-n3-tests: vendored snapshot (manifest + the 178 files it references, ~850K) of w3c/N3 @ 97653d4, so the suite runs fully offline - __tests__/spec/spec-test.ts: parses the manifest with n3, runs each entry through n3reasoner, and compares graphs by RDF isomorphism (jest-rdf), mapping the cwm-style test:options onto EYE output modes - __tests__/spec/skip-list.json: 39 known EYE deviations recorded with reasons so CI stays green while they are triaged; 50/89 manifest entries currently pass - npm run test:spec + a non-release-blocking spec-tests CI job Closes #336 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jeswr
force-pushed
the
test/spec-tests-runner
branch
from
July 4, 2026 23:27
f5a35d1 to
b1b5bef
Compare
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'EYE JS Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.25.
| Benchmark suite | Current: b1b5bef | Previous: d129aee | Ratio |
|---|---|---|---|
Run socrates query |
16.01 ops/sec (±4.93%) |
22.2 ops/sec (±2.39%) |
1.39 |
Executing the socrates query |
117 ops/sec (±19.58%) |
3890 ops/sec (±1.67%) |
33.25 |
Run deep taxonomy benchmark [10] |
6.92 ops/sec (±0.43%) |
18.83 ops/sec (±6.56%) |
2.72 |
Run deep taxonomy benchmark [50] |
0.26 ops/sec (±0.38%) |
19.63 ops/sec (±7.26%) |
75.50 |
Run deep taxonomy benchmark [100] |
0.04 ops/sec (±0.69%) |
18.67 ops/sec (±6.95%) |
466.75 |
Run deep taxonomy benchmark [10] [reasoning only] |
7.8 ops/sec (±16.64%) |
4107 ops/sec (±1.65%) |
526.54 |
Run deep taxonomy benchmark [50] [reasoning only] |
0.65 ops/sec (±23.07%) |
4147 ops/sec (±1.85%) |
6380 |
Run deep taxonomy benchmark [100] [reasoning only] |
0.17 ops/sec (±24.95%) |
4136 ops/sec (±1.60%) |
24329.41 |
Run timbl + foaf + rdfs rules |
2.05 ops/sec (±2.66%) |
17.23 ops/sec (±6.18%) |
8.40 |
Run timbl + foaf + owl2rl rules |
1.22 ops/sec (±1.56%) |
17.03 ops/sec (±3.91%) |
13.96 |
Run timbl + rdfs rules |
4.7 ops/sec (±2.46%) |
18.28 ops/sec (±6.60%) |
3.89 |
Run timbl + owl2rl rules |
6 ops/sec (±0.27%) |
17.1 ops/sec (±6.85%) |
2.85 |
Run timbl + foaf + rdfs rules [string] |
2.13 ops/sec (±0.21%) |
18.45 ops/sec (±7.08%) |
8.66 |
Run timbl + foaf + owl2rl rules [string] |
1.26 ops/sec (±0.13%) |
18.54 ops/sec (±6.64%) |
14.71 |
Run timbl + rdfs rules [string] |
4.81 ops/sec (±0.30%) |
18.77 ops/sec (±6.77%) |
3.90 |
Run timbl + owl2rl rules [string] |
6.19 ops/sec (±0.26%) |
18.98 ops/sec (±6.47%) |
3.07 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @jeswr
Addresses review on #1961: the upstream test suite should not be committed to this repo. - Remove the vendored __tests__/spec/w3c-n3-tests/ snapshot (180 files). - Add scripts/fetch-n3-tests.ts: downloads tests/N3Tests from w3c/N3 at a pinned commit into the git-ignored __tests__/spec/.w3c-n3-tests/; a no-op once present. npm run spec:fetch, invoked first by npm run test:spec. - CI: cache that directory with actions/cache keyed on the fetch script (which pins the commit), so runs stay deterministic and cache-hit fast. The spec-tests job stays out of the release job's needs. - spec-test.ts reads the fetched suite (via cacheDir), throws a helpful error if it is missing, and applies a small self-healing in-code patch for the upstream manifest typo :cwm_includes_t4:cwm_includes_t6 (filed as w3c-cg/N3#232) instead of patching a committed file. - README + .gitignore updated. Closes #336 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚧 Draft — agent-generated PR. Written by an AI agent working on the issue backlog; please review before considering it for merge.
Closes #336
What this adds
A jest runner for the reasoning part of the W3C N3 test suite (
tests/N3Tests/manifest-reasoner.ttl), runnable with:Per review, the upstream test suite is not committed to this repo — it is fetched at a pinned commit and cached in CI.
scripts/fetch-n3-tests.ts(npm run spec:fetch) — downloadstests/N3Testsfromw3c/N3at a pinned commit (N3_TESTS_COMMIT) into the git-ignored__tests__/spec/.w3c-n3-tests/. It is a no-op once the directory is present, so local re-runs and CI cache hits skip the download.npm run test:specruns it first.spec-testsjob wraps the run inactions/cache@v4, keyed onhashFiles('scripts/fetch-n3-tests.ts')(which holds the pin), so runs are deterministic and a cold cache only downloads once; bumping the pin busts the cache automatically. The job is intentionally not in thereleasejob'sneeds— a newly surfacing deviation should be triaged into the skip list, not block releases.__tests__/spec/spec-test.ts— parses the fetched manifest with the already-presentn3dependency, runs eachtest:TestN3Reasonentry throughn3reasoner, and compares the derived graph to the reference by RDF isomorphism (jest-rdf/rdf-isomorphic, already a devDependency). The cwm-styletest:optionsmap onto EYE output modes (conclusions→derivations,data→deductive_closure, neither →deductive_closure_plus_rules), and output/reference graphs are rebased onto a common base IRI (n3reasonerloads its input asdata_0.n3swhile the references resolve relative IRIs against the original input file name). If the suite is missing it throws with a pointer tonpm run spec:fetch.__tests__/spec/skip-list.json— every known EYE deviation recorded with a reason, so the suite stays green while deviations are triaged one by one. Removing an entry re-enables the test.jest.spec.config.json) +testPathIgnorePatternsin the main config, so the coverage-thresholded unit suite is unaffected.Upstream manifest typo
The pinned manifest concatenates two entries without whitespace in
mf:entries—:cwm_includes_t4:cwm_includes_t6— which Turtle parses as a single, undefined prefixed name (:is legal in local names), so both tests would silently vanish. Since the suite is now fetched unpatched,spec-test.tsapplies a small self-healing in-code patch (insert the missing space) to the manifest text before parsing; it becomes a no-op once upstream fixes it. Filed upstream as w3c-cg/N3#232.Current results
Local run (both cold-fetch and warm-cache paths):
Tests: 39 skipped, 51 passed, 90 total(the extra test asserts the manifest loaded), ~20 s. The 39 skips cluster into: WASM sub-reasoner gaps (log:conclusionneedsshell/2/exec— same root as #873 / eyereasoner/eye#177), tests that dereference sibling files vialog:semantics(not exposed through the single-documentn3reasonerAPI),math:numeric edge cases, EYE output constructs then3.jsparser rejects, and reference files that aren't standalone-parseable. Each entry inskip-list.jsoncarries its specific reason.Notes
@jeswr will review — expect a delay; active review happens Wed–Fri.
🤖 Generated with Claude Code