Repository navigation
Preserve literal numeric behavior for count-named fields (#1346) - #1347
Conversation
Review notesSummary: the change fixes #1346. Literal data under count-named keys keeps its ordinary node type and equality, Correctness
Cleanup
Tests and docs
|
|
Review notes for #1347 (head What I checked: built the PR head and its base ( 1. Fractional tokens that round to a whole double are now enforced (
The new tests cover fractional behaviour only with 2. Error messages report the rounded value for large finite float limits (
3. Contains annotation value type depends on magnitude (
4. Cleanup
Not a finding: the metaschema reports 🤖 Generated with Claude Code |
|
Review notes for #1347 (head 1. Count-named literal data with an unrepresentable exponent now fails schema load ( The capture parser tracks every float whose field name matches a count keyword, including inside
The previous head ( 2. Plain integer limits now print in exponent form ( Out-of-int-range arguments are formatted with
The earlier contract was that plain integers keep their full spelling. The tests 3. Design and cleanup
I did not rerun the test suites or check CI. 🤖 Generated with Claude Code |
|
Follow-up: my second round of notes is addressed in
I have not rerun my 304-schema probe or the edge cases against Two new pieces I have not reviewed and that I would look at before merging:
The retained 🤖 Generated with Claude Code |
|
Independent pass on Confirmed fixed. The 304-schema probe (8 count keywords x 38 limit spellings x 9 instances) and the literal-data probes behave as intended. Sidecar, lifetime, concurrency, exports. 20,000 compiled schemas drained to one entry after a GC plus one touch of the map. 8 threads compiling different schemas with GCs running showed no cross-talk. 1. A stale lexeme overrides a replaced value ( The guard 2. Active keyword with an unrepresentable exponent throws at load (
3. Tests. Nothing in the suite would catch item 1, 4. Design notes
🤖 Generated with Claude Code |
|
Follow-up on the fourth review, against I marked the findings in the review tool from the evidence you supplied (
Finding 5 can still change results: a deep-copied tree can enforce a different limit than the original. It is explicit in the tests and the PR description, which is a reasonable place to leave it. The YAML underscore item applies to 2.x only and is covered on #1348. I can rebuild the head and re-run the 304-schema probe plus the stale-token case to confirm independently if that is useful. 🤖 Generated with Claude Code |
|
Independent verification of Verified
Outcomes
Finding 5 is still a compatibility concern. It affects which limit is enforced, not only precision: for Finding 6, measured: a New, low severity
Observation, no finding: on master, YAML 🤖 Generated with Claude Code |
|
Follow-up on I compared it with
Still open from the earlier pass, unchanged: the 🤖 Generated with Claude Code |
Refs #1346. Follow-up to the unreleased #1334 change (#1341).
Preserve ordinary parsing for count-named literal data while retaining exact count-token semantics during schema binding. Fractional tokens such as
1e-400keep their existing fallback; plain integer arguments such as3000000000print in full. Literal/annotation/unknown-keyword data can contain exponents outside BigDecimal's range without a count-specific load failure.The configured node factory creates the tree unchanged. Raw lexemes are held in an internal weak identity sidecar. Each entry records its original numeric node weakly and a read-time numeric-value snapshot. A replaced or mutated node invalidates its old lexeme when a new schema is built from the tree; even a replacement with the same rounded value is distinguished by identity. This does not make already-compiled validators dynamically mutable.
Count binding parses/classifies once, caches error strings and uses shared defaults/static int-bound constants. Accepted YAML floating separators are normalized consistently with the YAML parser. Contains annotations use the node's own
numberValue(), including its type; exact comparison information does not change annotation representation. Plain integer diagnostics use fixed literal expectations, not a formula copied from the implementation.Known boundaries and retained choices:
1e400fits;1e999999999999remains rejected as on the base. This PR does not add an arbitrary-exponent numeric representation. Supplied floating-point Infinity nodes still use sign-aware saturation.USE_BIG_DECIMAL_FOR_FLOATSwhen copied schemas must retain exact count semantics; both ordinary-copy fallback and exact-reader copy behavior are tested.$refcan activate those same objects as schemas. A reference intoconstis tested. Weak ownership prevents the sidecar from retaining released documents.Automated coverage now includes replaced/equal-rounded/mutable numeric nodes, YAML underscore floats, identity isolation, a released owner with a custom numeric-node back-reference, queue cleanup, eight concurrent compilation workers with GCs, copy precision, and the earlier literal/precision/reference/message suites.
A packaged-jar test runs automatically in Maven's
verifyphase, which CI already invokes. It checks class contents and OSGi exports on every JDK; Java 9+ additionally checks explicit module ownership and JPMS exports. No production test hooks or new plugin dependencies are introduced.Validation:
mvn -B clean verifypassed independently on JDK 17/21/25: 10,423 unit tests + 1 packaged-artifact check per run, zero failures/errors, 30 existing skips. Focused regression suites: 400 tests, zero failures/errors. No existing tests are excluded. Whitespace checks passed.Pre-change GitNexus reader/registry impact remains CRITICAL. Staged scans omit newer helper coverage and do not establish low risk; source review, sidecar tests, packaged-artifact verification and full JDK suites supplement the graph.
Message-format decision: retain the existing formatting in these PRs. The low-severity provenance difference (for example,
3000000000from text versus3E+9from a supplied DoubleNode) remains documented, not marked fixed. A source-independent formatting policy is deferred to a separate decision. The snapshot ternary intentionally shares the captured String object when its content matches, avoiding retention of a duplicate String; the follow-up source comment explains this. That follow-up changes no executable code.