Conversation
The eager sanitizer only reported on `sat`, so a query Z3 answered `unknown` passed as "no out-of-bounds access" -- including a Ctrl+C, which Z3 swallows during check() and turns into unknown, so the kernel just kept running. The compiled sanitizer already treats unknown as unchecked (D11); this does the same on the eager side. An undecided access becomes an UndecidedAccessRecordZ3 (op, tensor, source location, Z3's reason): appended to `records` without abort_on_error, printed as an "UNCHECKED MEMORY ACCESS" warning with it. It is not a finding, so the program does not exit. A Ctrl+C that Z3 caught is re-raised as KeyboardInterrupt.
Performance Benchmark
Iterations: 1 warmup + 20 measured |
This branch has not been deployed
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
The eager sanitizer only reported on
sat(sanitizer.py:441,if solver.check() != sat: return), so a query Z3 answeredunknownpassed as "no out-of-bounds access". The compiled sanitizer already treatsunknownas unchecked (decision D11); this PR does the same on the eager side.Two ways this showed up:
records == []and exit status 0, with or withoutabort_on_error.unknownwith reason"interrupted from keyboard". Python never sees aKeyboardInterrupt, so the check passed silently and the kernel kept running.What changes:
unknownanswer creates a newUndecidedAccessRecordZ3insanitizer/data.py. It holds the op type, the resolved tensor and its arg name, the source location, and Z3'sreason_unknown(). There is no witness address.abort_on_error, the record goes intosanitizer.records, so a caller checkingnot san.recordsis no longer misled.abort_on_error,print_undecided_recordprints anUNCHECKED MEMORY ACCESSwarning and the program keeps running. An undecided access is not a finding, which matches the compiled side, where unknown means unsupported rather than a violation.KeyboardInterrupt.Notes for reviewers:
unknowntoday comes from a Ctrl+C or a resource limit; a hard query hangs instead of returningunknown. Adding a timeout would turn slow queries into "unchecked", so it is left as a separate decision.UndecidedAccessRecordZ3is appended at the end ofsanitizer/data.py, where the compiled-sanitizer stack also appendsCompiledSanitizerRecord. Rebasing that stack onto this PR will hit a small both-sides-added conflict there; keep both.Test Plan
tests/end_to_end/test_sanitizer.py. Each makes Z3 answerunknowndeterministically: settingrlimit=1on the solver stands in for any query Z3 gives up on, independent of machine speed.test_solver_unknown_records_access_as_unchecked: an out-of-bounds load plus a deferred in-loop store both becomeUndecidedAccessRecordZ3, with the right op type, tensor arg and source line.test_solver_unknown_warns_without_aborting: withabort_on_error=True, the warning is printed and there is noSystemExit.test_solver_interrupted_by_ctrl_c_raises_keyboard_interrupt: a Ctrl+C reason raisesKeyboardInterrupt.main's sanitizer and pass with this change. Command:pytest tests/end_to_end/test_sanitizer.py -k solver_.Related Issues
Follow-up to D11 of the compiled-sanitizer work, which fixed only the compiled side.
Breaking Changes
SymbolicSanitizer.recordscan now also containUndecidedAccessRecordZ3entries, not onlyOutOfBoundsRecordZ3.abort_on_error=True, an undecided access now prints a warning. The exit status is unchanged (0).Checklist
npm run build:frontendif the PR modified any TypeScript code. (N/A: no TypeScript changes)