fix(codegen): enforce checked array access semantics#69
Merged
Conversation
luisleo526
marked this pull request as ready for review
July 17, 2026 19:40
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.
Summary
array.get/set/remove, including valid negative indicesfirst/last/pop/shiftsetvalue evaluation before an errorMasking bugs closed
The checked-access change exposed two older bugs that would otherwise have hidden regressions:
array<UDT>was incorrectly classified as aliasable and generated a non-const reference to a temporary;array<array<UDT>>access.Both paths now have compile-and-run controls. The tests also cover local/global
naindices, infinity before integer conversion,vector<bool>proxies, C++ runtime error propagation, and post-error statement suppression.Validation
1690 passed, 2 skipped(full engine-enabled pytest suite)na, and infinity277/277(263success +14expected-error fixtures)254/254f2f14882: data522 OK + same 17 errors; corpus254/254 OK; no status or error-text transitions92/92; corpus11/1171/71status ok, emptylast_error,59E / 10S / 1M / 1W, no tier downgradelast_errorTested commit:
9b08d9edb7e76b5e70809848cd19d83f13c1f5bdTested tree:
3edc870a712a1a84e821b6b8641fee30b5a6cd08Runtime provenance for the corpus tape gate: engine test head
060eb4cdtree471c83f4, identical to publicorigin/mainfde4f147tree471c83f4; freshly built library SHA-25672f3840574bd81b25d4741f7eed3607adcaea5a168869bac5b82ded31ceff780.B3ar bug-masking exception
70 of the 71 standard tapes are byte-identical to the frozen accepted tapes. The sole intentional structural change is
b3ar-trades-ehlers-dominant-cycle-stochastic-rsi-v2(Weak -> Weak):get; checkedpopis tape-neutrallag == maxPeriod,n == 0, and Pine's descending loop visitsi = 0theni = -1-1to a C++ vector index and ASan reports a heap-buffer-overflow exactly 8 bytes beforefiltBuffer-1normalization to the final element and completes cleanly under ASan/UBSan-O0,-O1,-O2, and-O1 -ffp-contract=off, ruling out stack-layout/optimizer noiseThe accepted raw tape is therefore a bug-masking UB artifact, not a valid no-regression oracle for this path. No promotion is claimed.
Campaign impact and residuals
This is expected to be score-neutral: the current corpus has no proven live negative-index execution, so no tier promotion is claimed without a TradingView oracle. Follow-up KI-48 scope remains explicit for checked
insert/fill/sliceranges,array.percentrankbounds, mixed-nacalculations, and broader collection/UDT reference-identity architecture.