Skip to content

[bugfix] applyVersionHint: cap "+"-form spec deps at "3.1" for XQTS 3.1 / HEAD#55

Open
joewiz wants to merge 1 commit into
eXist-db:developfrom
joewiz:bugfix/applyVersionHint-cap-3.1-on-develop
Open

[bugfix] applyVersionHint: cap "+"-form spec deps at "3.1" for XQTS 3.1 / HEAD#55
joewiz wants to merge 1 commit into
eXist-db:developfrom
joewiz:bugfix/applyVersionHint-cap-3.1-on-develop

Conversation

@joewiz
Copy link
Copy Markdown
Member

@joewiz joewiz commented May 20, 2026

[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+), 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 produced 5,697 spurious XQST0031 failures, masking the real XQ 3.1 conformance picture.

This patch threads the active TestSetRef.xqtsVersion through to a new applyVersionHint helper and picks the prepended version per-suite:

Prepended version
Explicit XQ40 spec dep "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

Impact

Measured 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 PR) 90.5% (28,258/31,224)

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 XQ4 dependency are unaffected — the specs.contains("XQ40") branch keeps prepending "4.0" for those.

Relationship to #50

Supersedes #50. The original branch was based on feature/qt4-xquery-update and carried ~25 unrelated commits (QT4 suite, XQFTTS, batch runner, etc.) that should ride with #49. This narrow version targets develop directly and contains only the applyVersionHint change — appropriate for the eXist 7.0 XQ 3.1 conformance focus before today's beta freeze.

Test plan

  • sbt compile clean
  • Re-run XQ 3.1 / HEAD against develop; expect ~90.5% pass rate, no regressions in tests declaring explicit XQ40

…+" 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>
Copy link
Copy Markdown
Member

@line-o line-o left a comment

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

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