[bugfix] applyVersionHint: cap "+"-form spec deps at "3.1" for XQTS 3.1 / HEAD#55
Conversation
…+" at "3.1" XQTS tests need a version declaration so eXist applies version-specific semantics. Without one, tests authored before XQuery 4.0 (strict XQ10 / XQ30 / XQ31 spec deps) run under whatever default eXist applies — typically XQ4 on next branches — and trip rules that changed in 4.0 (reserved function names, default function namespace, default param values, etc.). The `+` form (`XQ31+`, `XQ40+`) means "this version or any later". The runner was previously hardcoding `xquery version "4.0"` for every `+`-form test, which `develop`'s exist-core rejects at parse time because the 4.0 parser flag isn't on develop yet. On the live XQTS HEAD catalog that meant 5,697 spurious XQST0031 failures, masking the real XQ 3.1 conformance picture. Fix: thread the active `TestSetRef.xqtsVersion` from `RunTestCaseInternal` through `runTestCaseWithExist` → `runTestCase` and pick the prepended version per-suite in a new `applyVersionHint` helper: XQ40 explicit → "4.0" "+" form, XQTS_3_1 / XQTS_HEAD → "3.1" "+" form, other suite → "4.0" Strict XQ31 / XQ30 / XQ10 → as declared No XQ spec dep → unchanged Measured impact on develop@4f09d0accc against qt3tests master @83993587: | Runner state | Pass rate | |-------------------------------------|--------------------| | HEAD + default (+ → "4.0") | 71.4% (22,050/30,872) | | HEAD + cap-3.1 (this commit) | 90.5% (28,258/31,224) | 90.5% is the canonical "XQ 3.1 conformance on the final spec" baseline for eXist 7.0. Tests that explicitly declare an XQ4 dependency are unaffected. Supersedes PR eXist-db#50, narrowed to develop scope (the original branch carried ~25 unrelated commits from the qt4-xquery-update integration branch). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
line-o
left a comment
There was a problem hiding this comment.
I think the comment would benefit from another iteration and could be a tad shorter too.
I would like to see the longer explanation to be added to the readme for human consumption and here have only a brief reference to exact input with and without "+" and what this select.
| * Strict deps like `XQ10 XQ30 XQ31` (no plus form) mark tests authored before | ||
| * XQuery 4.0; running them as XQ4 trips changed rules. The `+` form means | ||
| * "this version or any later" — for XQ 3.1 / live HEAD measurements we cap | ||
| * it at "3.1" so engines that don't accept `xquery version "4.0"` (develop's |
There was a problem hiding this comment.
(develop's exist-core)
Please change to (as exist-db's current develop HEAD)
| * Tests need a version declaration so eXist applies version-specific semantics. | ||
| * Strict deps like `XQ10 XQ30 XQ31` (no plus form) mark tests authored before | ||
| * XQuery 4.0; running them as XQ4 trips changed rules. The `+` form means | ||
| * "this version or any later" — for XQ 3.1 / live HEAD measurements we cap |
There was a problem hiding this comment.
for XQ 3.1
could be "for XQ31" instead to make the example more explicit
| * - If the query already declares a version, leave it alone. | ||
| * - If a spec dep names `XQ40` explicitly, prepend "4.0". | ||
| * - If a spec dep uses the `+` form, prepend the suite's own floor: | ||
| * "3.1" for XQTS_3_1 / XQTS_HEAD, "4.0" otherwise. |
There was a problem hiding this comment.
Here we have new identifiers that are not explained before "3.1" and XQTS_3_1.
There is not a single plus form written out anywhere ... I assume it is XQ31+, XQ10+.
I would assume XQ10+ to run with xquery 4.0 as well.
[This response was co-authored with Claude Code. -Joe]
Summary
XQTS tests need a version declaration so eXist applies version-specific semantics. The runner was previously hardcoding
xquery version "4.0"for every+-form spec dep (XQ31+,XQ40+), whichdevelop'sexist-corerejects at parse time because the 4.0 parser flag isn't ondevelopyet. On the live XQTS HEAD catalog that produced 5,697 spurious XQST0031 failures, masking the real XQ 3.1 conformance picture.This patch threads the active
TestSetRef.xqtsVersionthrough to a newapplyVersionHinthelper and picks the prepended version per-suite:XQ40spec dep"4.0"+form,XQTS_3_1/XQTS_HEAD"3.1"+form, other suite"4.0"XQ31/XQ30/XQ10Impact
Measured on
develop@4f09d0acccagainstqt3testsmaster@83993587:+→"4.0")90.5% is the canonical "XQ 3.1 conformance on the final spec" baseline for the eXist 7.0 release. Tests that explicitly declare an
XQ4dependency are unaffected — thespecs.contains("XQ40")branch keeps prepending"4.0"for those.Relationship to #50
Supersedes #50. The original branch was based on
feature/qt4-xquery-updateand carried ~25 unrelated commits (QT4 suite, XQFTTS, batch runner, etc.) that should ride with #49. This narrow version targetsdevelopdirectly and contains only theapplyVersionHintchange — appropriate for the eXist 7.0 XQ 3.1 conformance focus before today's beta freeze.Test plan
sbt compilecleandevelop; expect ~90.5% pass rate, no regressions in tests declaring explicitXQ40