Skip to content

[Based on #108] debug: add typed artifact modes and Wasm sidecars - #112

Open
cpunion wants to merge 2 commits into
codex/debug-artifact-policy-2164-20260801from
codex/typed-debug-artifacts-2164-20260801
Open

[Based on #108] debug: add typed artifact modes and Wasm sidecars#112
cpunion wants to merge 2 commits into
codex/debug-artifact-policy-2164-20260801from
codex/typed-debug-artifacts-2164-20260801

Conversation

@cpunion

@cpunion cpunion commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Implements the typed debug-artifact part of xgo-dev#2164 on top of #108.

Problem

After a target can retain DWARF, the build still cannot distinguish embedded, host-owned, external, and omitted debug artifacts. Wasm also has no standards-based way to publish a deployable module with debugger metadata in a sidecar.

Changes

  • add -debug-artifact=embedded|external|host|none and resolve it into typed -w intent without changing the current safe default;
  • keep debug-artifact selection independent of pclntab selection;
  • implement the WebAssembly external_debug_info convention with an adjacent URL-escaped .debug.wasm sidecar;
  • preserve every standard Wasm section byte-for-byte in the deployable module while removing embedded DWARF/relocation sections;
  • atomically publish sidecar and main artifacts, and remove stale sidecars on non-external rebuilds and llgo clean;
  • add an Ubuntu/Go 1.26 CI check that builds real LLGo embedded and external Wasm artifacts and inspects their final sections.

The external sidecar is the complete linked debug module, which the WebAssembly convention permits and which preserves the exact code/data layout used by DWARF. Runtime pclntab packaging is unchanged.

Verification

  • macOS full related-package suite (excluding the pre-existing hanging stdio test): 76.0% statement coverage;
  • macOS and Linux/amd64 focused tests: internal/wasmdebug 94.3%, all new flag/policy/finalization tests pass;
  • real LLGo WASI builds on macOS and Linux/amd64 verify:
    • embedded module contains .debug_info;
    • external main contains external_debug_info and no .debug_info;
    • sidecar contains .debug_info;
    • rebuilding the same output with none removes the stale sidecar.

@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.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

0f6a37f15b28 | workflow run | long-term charts

Program measurements

Platform Workload File size vs main Build vs main Run vs main
Linux cprintf 18544 B +0.0% 327.002 ms -20.7% (better) 1.226 ms -21.0% (better)
Linux fmtprintf 2217600 B +0.2% (worse) 3.223 s -16.4% (better) 2.414 ms -26.6% (better)
Linux println 71504 B -1.6% (better) 332.235 ms -17.0% (better) 1.561 ms -6.7% (better)
macOS cprintf 84672 B +0.0% 332.763 ms -19.7% (better) 2.376 ms -33.8% (better)
macOS fmtprintf 2361520 B +0.7% (worse) 2.568 s -34.8% (better) 16.349 ms -30.1% (better)
macOS println 125712 B -1.0% (better) 321.135 ms -22.5% (better) 3.664 ms -49.5% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs main
Linux BenchmarkLookupPCRandom 13.410 ns/op -0.5% (better)
Linux BenchmarkMergeCompilerFlags 153.600 ns/op -0.6% (better)
Linux BenchmarkMergeLinkerFlags 98.700 ns/op -2.6% (better)
Linux BenchmarkChannelBuffered 33.980 ns/op -2.2% (better)
Linux BenchmarkChannelHandoff 25617 ns/op -20.0% (better)
Linux BenchmarkDefer 42.230 ns/op -25.0% (better)
Linux BenchmarkDirectCall 1.555 ns/op -0.5% (better)
Linux BenchmarkGlobalRead 1.869 ns/op +19.8% (worse)
Linux BenchmarkGlobalWrite 2.485 ns/op -0.4% (better)
Linux BenchmarkGoroutine 30767 ns/op -59.3% (better)
Linux BenchmarkInterfaceCall 8.091 ns/op +3.8% (worse)
Linux BenchmarkRuntimeGetG 1.870 ns/op -64.8% (better)
macOS BenchmarkLookupPCRandom 11.430 ns/op -8.1% (better)
macOS BenchmarkMergeCompilerFlags 92.380 ns/op -25.8% (better)
macOS BenchmarkMergeLinkerFlags 61.630 ns/op -11.1% (better)
macOS BenchmarkChannelBuffered 20.410 ns/op -26.4% (better)
macOS BenchmarkChannelHandoff 6467 ns/op -7.7% (better)
macOS BenchmarkDefer 25.360 ns/op -32.2% (better)
macOS BenchmarkDirectCall 0.968 ns/op -33.4% (better)
macOS BenchmarkGlobalRead 1.030 ns/op -14.9% (better)
macOS BenchmarkGlobalWrite 0.943 ns/op -36.6% (better)
macOS BenchmarkGoroutine 28036 ns/op -11.4% (better)
macOS BenchmarkInterfaceCall 4.105 ns/op -24.0% (better)
macOS BenchmarkRuntimeGetG 2.066 ns/op -19.8% (better)

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

Warning

  • Persistent publishing is unavailable because no data token is configured.

@cpunion
cpunion force-pushed the codex/debug-artifact-policy-2164-20260801 branch from 1cc42d4 to 2d13fd3 Compare August 1, 2026 16:08
@cpunion
cpunion force-pushed the codex/typed-debug-artifacts-2164-20260801 branch from 1dd635a to 0f6a37f Compare August 1, 2026 16:49
@cpunion
cpunion force-pushed the codex/debug-artifact-policy-2164-20260801 branch from 2d13fd3 to 5b3dbe4 Compare August 2, 2026 07:05
@cpunion
cpunion force-pushed the codex/typed-debug-artifacts-2164-20260801 branch from 0f6a37f to dde8ca4 Compare August 2, 2026 07:05
@cpunion
cpunion force-pushed the codex/debug-artifact-policy-2164-20260801 branch from 5b3dbe4 to c9c9171 Compare August 3, 2026 00:44
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