Skip to content

[Based on #139] debug: validate fault boundaries and final Wasm DWARF - #140

Open
cpunion wants to merge 5 commits into
codex/debug-dwarf-integration-2164-20260802from
codex/debug-fault-boundary-2164-20260802
Open

[Based on #139] debug: validate fault boundaries and final Wasm DWARF#140
cpunion wants to merge 5 commits into
codex/debug-dwarf-integration-2164-20260802from
codex/debug-fault-boundary-2164-20260802

Conversation

@cpunion

@cpunion cpunion commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Continues xgo-dev#2164 on top of #139.

This change closes native fault/boundary acceptance gaps and makes clean final WebAssembly DWARF a hard gate without changing runtime or scheduler behavior:

  • compiles C, C++, cgo preambles, and LLGoFiles with DWARF whenever the shared typed debug policy emits Go DWARF;
  • verifies exact user source locations for explicit panic, integer division by zero, invalid memory, and a real host trap;
  • verifies ordered Go -> C -> Go callback frames;
  • builds a separate -O2 artifact, requires nested LLVM inline frames, and steps back to the physical caller;
  • temporarily pins the conservative Binaryen DWARF range repair from Repair invalid DWARF scope ranges after transforms WebAssembly/binaryen#8964;
  • strictly verifies the final Asyncify-transformed browser embedded Wasm and external DWARF sidecar with llvm-dwarfdump --verify;
  • makes final WASI verification mandatory and covers both embedded and external DWARF artifacts;
  • runs the native fixture in the existing Darwin/Linux primary LLDB lane, the WASI gates in llgo.yml/wasi-debug.yml, and the browser fixture in Chrome 151.

Validation:

  • python3 check.py wasm-opt in the pinned Binaryen tree
  • 73-CU LLGo + Emscripten final embedded browser Wasm: llvm-dwarfdump --verify reports No errors.
  • browser external deployment module and .debug.wasm sidecar: No errors.
  • 90-CU WASI embedded artifact and external .debug.wasm sidecar: No errors.
  • go test -timeout 10m ./internal/debugabi ./internal/wasmdebug ./internal/browserdebug ./cmd/internal/browser ./cmd/internal/debug
  • full go test ./internal/build: pass in 290.468s after the final-gate audit
  • native LLDB acceptance on Darwin/arm64 with Apple LLDB 17: NATIVE_DEBUG_ACCEPTANCE_OK
  • native LLDB acceptance on Linux/x86_64 with LLDB 19.1.7: NATIVE_DEBUG_ACCEPTANCE_OK
  • Node language-extension tests, shell syntax, workflow YAML, and diff validation

The Binaryen pin can return to the supported Emscripten release after the upstream repair lands and is released.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cpunion cpunion changed the title [Based on #139] debug: validate native fault and boundary semantics [Based on #139] debug: validate fault boundaries and final browser DWARF Aug 2, 2026
@cpunion
cpunion force-pushed the codex/debug-fault-boundary-2164-20260802 branch from ac779f5 to 9fe97a2 Compare August 2, 2026 12:47
@cpunion cpunion changed the title [Based on #139] debug: validate fault boundaries and final browser DWARF [Based on #139] debug: validate fault boundaries and final Wasm DWARF Aug 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

6032fec376e8 | workflow run | long-term charts

Program measurements

Platform Workload File size vs main Build vs main Run vs main
Linux cprintf 20592 B +11.0% (worse) 568.455 ms +37.9% (worse) 1.278 ms -17.7% (better)
Linux fmtprintf 5828200 B +163.3% (worse) 6.229 s +61.6% (worse) 2.450 ms -25.5% (better)
Linux println 691544 B +851.8% (worse) 558.065 ms +39.5% (worse) 1.594 ms -4.7% (better)
macOS cprintf 50784 B -40.0% (better) 467.011 ms +12.7% (worse) 3.518 ms -1.9% (better)
macOS fmtprintf 2749760 B +17.2% (worse) 6.280 s +59.4% (worse) 19.575 ms -16.2% (better)
macOS println 111264 B -12.4% (better) 449.987 ms +8.5% (worse) 3.968 ms -45.3% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs main
Linux BenchmarkLookupPCRandom 13.410 ns/op -0.5% (better)
Linux BenchmarkMergeCompilerFlags 150.500 ns/op -2.6% (better)
Linux BenchmarkMergeLinkerFlags 94.980 ns/op -6.2% (better)
Linux BenchmarkChannelBuffered 33.400 ns/op -3.9% (better)
Linux BenchmarkChannelHandoff 25351 ns/op -20.9% (better)
Linux BenchmarkDefer 45.280 ns/op -19.6% (better)
Linux BenchmarkDirectCall 1.557 ns/op -0.4% (better)
Linux BenchmarkGlobalRead 1.873 ns/op +20.1% (worse)
Linux BenchmarkGlobalWrite 2.490 ns/op -0.2% (better)
Linux BenchmarkGoroutine 34817 ns/op -53.9% (better)
Linux BenchmarkInterfaceCall 9.386 ns/op +20.4% (worse)
Linux BenchmarkRuntimeGetG 2.181 ns/op -58.9% (better)
macOS BenchmarkLookupPCRandom 12.370 ns/op -0.6% (better)
macOS BenchmarkMergeCompilerFlags 130.200 ns/op +4.6% (worse)
macOS BenchmarkMergeLinkerFlags 86.940 ns/op +25.4% (worse)
macOS BenchmarkChannelBuffered 22.020 ns/op -20.6% (better)
macOS BenchmarkChannelHandoff 6915 ns/op -1.3% (better)
macOS BenchmarkDefer 26.220 ns/op -29.9% (better)
macOS BenchmarkDirectCall 1.017 ns/op -30.0% (better)
macOS BenchmarkGlobalRead 1.020 ns/op -15.8% (better)
macOS BenchmarkGlobalWrite 1.016 ns/op -31.7% (better)
macOS BenchmarkGoroutine 25140 ns/op -20.6% (better)
macOS BenchmarkInterfaceCall 5.111 ns/op -5.3% (better)
macOS BenchmarkRuntimeGetG 2.028 ns/op -21.3% (better)

Compared only with the latest matching platform in the main series.

@cpunion

cpunion commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Benchmark context: the large Linux whole-file deltas are the expected debugger-owned DWARF cost of xgo-dev#2164 Go-compatible defaults (native = embedded), not an equivalent loadable-footprint increase. Against the latest main baseline, Linux text/data are cprintf 410/13,813 vs 410/12,949 bytes; println 21,929/30,789 vs 21,337/29,283 bytes; and fmtprintf 768,473/997,255 vs 759,177/982,167 bytes. The proposal artifact-role gate separately measures debug and deployment outputs, and the Targets lane verifies that host DWARF leaves flashed bytes identical. Production stripping remains explicit through -debug-artifact=none or -w; full-DWARF build-time cost remains tracked.

@cpunion

cpunion commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Compatibility shard follow-up:

  • The first run's only failure was TestRuntimeSetFinalizerTinyObjects observing 1/32 finalizers within its 3-second window.
  • The current head does not change that test or the finalizer/GC implementation.
  • A Linux/x86_64 Go 1.24.2 reproduction capped at 6 GiB / 4 CPUs passed 10/10 repetitions of the focused test.
  • The failed job was rerun without code changes. Attempt 2 passed; github.com/goplus/llgo/test/go and the full 1075-second shard both completed successfully.

This is therefore treated as a timing flake. No debugger acceptance assertion or runtime behavior was weakened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant