[Based on #2033] ssa,runtime: return runtime.Error values for assertions and faults#2034
Open
cpunion wants to merge 18 commits into
Open
[Based on #2033] ssa,runtime: return runtime.Error values for assertions and faults#2034cpunion wants to merge 18 commits into
cpunion wants to merge 18 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cpunion
force-pushed
the
codex/stage5-recover-errors
branch
3 times, most recently
from
July 8, 2026 07:04
9662dbc to
3076e79
Compare
cpunion
force-pushed
the
codex/stage5-recover-errors
branch
3 times, most recently
from
July 9, 2026 05:35
f4d93ca to
207675c
Compare
8 tasks
12 tasks
cpunion
force-pushed
the
codex/stage5-recover-errors
branch
from
July 16, 2026 04:37
207675c to
bd5f8b5
Compare
cpunion
force-pushed
the
codex/stage5-recover-errors
branch
3 times, most recently
from
July 19, 2026 00:14
94ecf4b to
1816aab
Compare
Store each immutable Func as one atomic pointer and validate the queried PC from the Func itself. This prevents concurrent cache replacement from combining a PC and function from different writers. Apply the same publication rule to the prebuilt function cache and stress multiple PCs during concurrent first use.
Give each package-backed locality block an owner-local TLS cache so hot accesses are O(1) regardless of the number of touched packages. Keep the block list only for GC reachability and teardown. Require locality variables to be unexported and reject go:linkname aliases. Add codegen, lifecycle, and 2/4/8-package performance coverage.
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
force-pushed
the
codex/stage5-recover-errors
branch
from
July 20, 2026 06:11
1816aab to
86d61bb
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.
Depends on #2033
Dependency
Stack: #2079 -> #2090 -> #2033 -> this PR.
#2033 supplies direct-deferred-call recover ownership on top of the GLS-backed runtime state. This PR adds the error-value and fault-signal behavior that depends on those semantics.
Problem
Failed type assertions previously panicked with a plain
errorString, so recovered values did not implementruntime.Errorlike gc. Fault recovery also omitted SIGBUS on supported Unix targets.Implementation
*runtime.TypeAssertionErrorfor failed non-comma-ok assertions, including missing-method lookup from ABI method tables.TypeAssertErrorfollowed byPanic.Conformance
Removed xfails for:
recover2.gorecover4.gozerodivide.gofixedbugs/issue73917.gofixedbugs/issue73920.gorecover1.goremains xfailed for the narrower recursive-panic residual: a plain sub-call inside the deferred function can still observe the panic. Three newly added regression cases for that unsupported behavior remain explicitly skipped with the same reason; no previously running test was disabled.Validation
Tests were serialized with
GOMAXPROCS=2,GOMEMLIMIT=8GiB, and-p=1where supported.ssa/clcoverage sweep completed; its only local failures were the six already-known Go 1.26.5 float-format golden differences (alias,invoke,multiret,struczero,complex, andcpkgimp).This supersedes the remaining runtime-error portion of #1882 without carrying its pre-stage-5 funcinfo implementation.