Add opt-in paths for JSON conversion errors - #487
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #487 +/- ##
==========================================
+ Coverage 92.09% 92.47% +0.37%
==========================================
Files 7 7
Lines 1784 1887 +103
==========================================
+ Hits 1643 1745 +102
- Misses 141 142 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PtrString exposes its materializing constructor after the current main removed conversion methods. Use that constructor when recovering an error path.
quinnj
force-pushed
the
investigate/json-error-paths
branch
from
October 2, 2026 06:23
0940554 to
7c16fd8
Compare
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.
Typed conversion errors currently identify the failed operation without locating the value in the input. Add
error_context=trueto the existing parsing entry points. A failing conversion then throws a qualifiedJSON.ParseErrorcontaining an RFC 6901 JSON Pointer, the value's starting byte, and the original exception and backtrace. Parsing{"counts":[1,"bad"]}into an integer-vector field identifies/counts/1at byte 14. Fixes #428.Tracking is opt-in and covers
parse,parse!, file/IO inputs and selectedLazyValues. Paths use input names, including renamed fields and escaped keys. Conversion hooks still receive their original exceptions and can recover. Diagnostics never replay constructors, hooks or partial mutations. A scoped record and a structural walk on failure recover the path; unrecoverable paths arenothing. Unrelated nested inputs and handled exceptions cannot leave a misleading child path. Configuration and initial lexing errors before conversion retain their existing behavior.The default entry path keeps diagnostics out of inference and execution, preserving default native compilation and avoiding a second conversion tree for downstream types. Enabled diagnostics have a separate cost and are not claimed to support native compilation. Error recovery materializes pointer-backed keys with
String(k), matching current master's removal of the old conversion methods. No exports or dependencies are added.Validation on final head 7c16fd8:
--trim=safe; its executable passes withJULIA_LOAD_CODEGEN_LIB=0. Enabled diagnostics are outside that claim. Strict documentation and doctests pass with local deployment disabled.Final-head performance checks use unchanged source snapshots, hashed small/large object and array inputs, identical dependencies, alternating process order and full decoded-value comparisons. Default and literal-false allocations match master on all four fixtures on floor/current Julia. Enabling diagnostics adds 32 bytes per parse in these fixtures. Two floor controls compile both unmodified sources in separate namespaces and rotate execution order: neither replaces existing shared methods, and median paired default/literal-false ratios range from 0.981 to 1.018 on the small-array and large-object fixtures. A fresh six-process floor run with normal package loading gives default ratios from 0.758 to 1.140 as host load varies. Earlier separate-process floor observations were slower under heavier contention; these controls do not reproduce a consistent regression, and neither a speedup nor universal timing parity is claimed. All raw runs are retained in the maintenance evidence.
An earlier Windows floor job exited with an access violation during the JSON test corpus. A paired unchanged-master/final-head run on the same Julia and dependency versions completed all 319 corpus markers and full tests for both sources. The original job's targeted rerun also passed without source changes. The earlier access violation remains unexplained; it is not presented as a fixed source defect.
This change was researched, implemented, independently reviewed and tested by Codex as part of an AI-driven maintenance review.
Co-authored by Codex