tsan: foundation for multi-race-per-session (--tsan-no-halt + parse_all_reports) - #221
Merged
Conversation
…ll_reports) Under halt_on_error=1 a session reports only its FIRST race, so distinct races in the same session are masked (an experiment on one _decimal session showed 10 distinct races surface when not halted, incl. _decimal Context races masked behind the count residual). This lands the two enabling pieces; the keep-policy sidecar (#3) and ingest side (#4) follow. #1 emit (__init__.py): --tsan-no-halt sets TSAN_OPTIONS halt_on_error=0 (report-and-continue). Opt-in; default stays 1. Detection is textual so races still score, and exit stays 66 (TSan's exitcode fires at exit if any error was reported). #2 parse (tsan_dedup.py): parse_all_reports(text, source_roots=None) splits the stdout on TSan report-start headers (WARNING/ERROR, not SUMMARY) and parses each chunk, returning the distinct races in stream order with an `order` index (so a caller can flag reports that FOLLOW a UAF/SEGV as possible corruption artifacts -- the first race is the trustworthy one). parse_report is UNCHANGED (first-report only), so the sibling catalog's signature contract is untouched -- purely additive. Verified on the real 13-block experiment log: 10 distinct races vs 1. +4 tests (multiple distinct races, dedup-by-signature, single/empty, parse_report-still-first-only); suite 1131 -> 1135. ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Multi-race-per-session, part 1 of 4 (the enabling pieces)
Under
halt_on_error=1a--tsansession reports only its first race, so distinct races in the same session are masked. An experiment on one real_decimalfleet session confirmed the payoff: 10 distinct races surface when we don't halt (vs 1 halted) — including independent_decimalContext races that were hidden behind the count residual, plus a cascade SEGV.This PR lands the two foundation pieces; the keep-policy sidecar (#3) and the ingest side (#4) follow in separate PRs.
#1 — emit (
__init__.py)--tsan-no-haltsetsTSAN_OPTIONS halt_on_error=0(report-and-continue). Opt-in; default stays1. Detection is textual so races still score, and exit stays66(TSan'sexitcodefires at exit when any error was reported — verified in the experiment).#2 — parse (
tsan_dedup.py)parse_all_reports(text, source_roots=None)splits the stdout on TSan report-start headers (WARNING/ERROR, deliberately notSUMMARY) and parses each chunk, returning the distinct races in stream order with anorderindex — so a caller can flag reports that follow a UAF/SEGV as possible corruption artifacts (the first race is the trustworthy one).parse_reportis unchanged (first-report only), so the sibling catalog's signature contract is untouched — purely additive.Verified on the real 13-block experiment log:
parse_all_reportsreturns 10 distinct races (count residual + its UAF faces + the_decimalContext races + asegvatorder=9) whereparse_reportreturns 1.Tests
+4 (
multiple distinct races,dedup-by-signature,single/empty,parse_report-still-first-only); suite 1131 → 1135;ruffclean.🤖 Generated with Claude Code