Merge parseInt fast-path (PR #285) + align SYS-REQ-061/062 surrogate FRETish - #287
Merged
Conversation
…g fixes, performance
Final state of the comprehensive proof review + bug-elimination pass.
Code fixes (6 real bugs found by the review, 5 fixed + 1 tracked):
- Empty-string key-component panic (8 sites incl. slice-expression variant
in Set depth!=0 branch) — FIXED, DEFECT-260726-QS2V / KI-1
- Set array-index-beyond-length data loss on scalar arrays — FIXED,
DEFECT-260727-WWWY
- ArrayEach non-array-root spurious callback — FIXED, DEFECT-260727-ARR1
- Delete trailing-comma malformation (whitespace+comma) — FIXED,
DEFECT-260726-3PSJ
- Cross-type Set corruption (array-index under object parent) — FIXED
via auto-coerce, DEFECT-260726-MFPA / KI-3
- Unescape lone-surrogate mishandling (synthesizes bogus non-BMP) — FIXED,
DEFECT-260727-SNGT
- ParseInt('-') false-success — tracked KI-2 (low)
- Set top-level array beyond-length returns error — tracked KI-4 (medium)
Fuzzing infrastructure:
- Structure-aware JSON fuzzer (grammar generator + 11 JSON-aware
mutations + 9 correctness gates) — now extracted to
github.com/probelabs/json-fuzz (public, importable)
- Path-mutation fuzzer, sequence fuzzer, encoding/json differential
- Hardened UTF coverage: raw multibyte, surrogate pairs, lone surrogates,
invalid UTF-8, control chars, exponent extremes, DoS gates
Specs:
- 5 new SYS-REQs (110-114) covering previously-underspecified behavior
- Boundary domains on parser variables (array_index, path_component_length)
- Hazard worst-cases enumerated across all requirements
- 2 new catalog overlay classes (element_type_partition, non_array_root_no_callback)
Performance:
- stringEnd SIMD fast path (12x on no-escape strings, 4.5x end-to-end Get)
Proof posture: L3 strict, 0 errors / 0 warnings, all checks enabled.
…ETish - bytes.go: parseInt fast path for <=18-digit numbers (from PR #285 by @trevorprater, 22-37% faster on short integers) - bytes_test.go: -9223372036854775807 MC/DC witness for the slow-path neg branch that the fast path made unreachable for short numbers - SYS-REQ-061/062: aligned FRETish variable with the U+FFFD substitution behavior (was 'returns_error_for_missing_low_surrogate', now 'substitutes_replacement_for_missing_low_surrogate' — matches the actual DEFECT-260727-SNGT fix and encoding/json behavior) - MC/DC witnesses updated to match the new variable names - KI-2 evidence freshness re-stamped after bytes.go edit
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.
Post-merge follow-up to #283.
Changes
negbranch.returns_error_for_missing_low_surrogate→substitutes_replacement_for_missing_low_surrogateto match the actual U+FFFD substitution behavior (DEFECT-260727-SNGT fix) and encoding/json oracle. MC/DC witnesses updated.Verification
go test ./... -count=1 -racepassesproof audit --scope full→ 0 errors / 0 warnings