Skip to content

[Based on #138] debug: integrate DWARF-safe defaults - #139

Open
cpunion wants to merge 25 commits into
codex/debug-acceptance-2164-20260802from
codex/debug-dwarf-integration-2164-20260802
Open

[Based on #138] debug: integrate DWARF-safe defaults#139
cpunion wants to merge 25 commits into
codex/debug-acceptance-2164-20260802from
codex/debug-dwarf-integration-2164-20260802

Conversation

@cpunion

@cpunion cpunion commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Integrates the source-debugging dependency chain required by xgo-dev#2164 on top of #138 without pulling scheduler implementation into the proposal.

  • uses the reviewed independent DebugRef return/select repairs instead of the older duplicate commits in debug: keep optimization and SSA rewrites DWARF-safe xgo-dev/llgo#2143
  • keeps the normal LLVM optimization pipeline enabled with DWARF and preserves defer locations and C ABI variable homes
  • keeps aggregate parameter homes authoritative in debug builds, avoiding invalid LLDB byval dereferences while retaining the optimized rewrite for non-debug builds
  • restores Go-compatible linked DWARF defaults while preserving typed embedded, host, external, and none artifact policy
  • preserves Darwin PC-line sites while suppressing only the address-site class that disturbs LLDB lexical scopes
  • stabilizes Darwin cold/warm debug-map archive paths
  • resolves outstanding review notes by guarding a moving anchor, clarifying site policy, using explicit PC-line naming, and updating the design documentation

Upstream review units remain xgo-dev#2183, xgo-dev#2184, xgo-dev#2143, xgo-dev#2148, xgo-dev#2157, xgo-dev#2142, and xgo-dev#2202. This PR is the latest-main combination and acceptance layer.

Validation:

  • full internal/build package: pass in 249.939s
  • full internal/cabi package: pass, including the aggregate debug-home regression
  • focused ssa, cl, and cmd/internal/debug: pass
  • native LLDB acceptance: 276/276, including slices and mutated aggregate parameters
  • DWARF return-order, Darwin pclntab line-site, and large-array C ABI probes: pass
  • real GOOS=js embedded and external browser artifacts build and load
  • exact pre-Asyncify objects pass llvm-dwarfdump verification across all 71 compile units

Binaryen's released Asyncify still exhibits WebAssembly/binaryen#6406 on this layer's final browser artifact. The stacked #140 closes that final-artifact gate with the repair proposed upstream as WebAssembly/binaryen#8964 and keeps strict llvm-dwarfdump --verify checks enabled; this PR does not weaken validation or change runtime semantics.

cpunion added 22 commits August 2, 2026 18:25
ssa.GlobalDebug inserts metadata-only DebugRefs between a return load and its Return. Treating those references as executable users prevents the existing gc-compatible order repair from running, while moving only the load would invalidate SSA order.

Move each related DebugRef with the load. This preserves LLGo compatibility for the behavior discussed in golang/go#77938; it does not make the unspecified Go expression order normative.
The single-case select repair moves receive-assignment LHS dependencies after the receive, as required by select evaluation order. Under ssa.GlobalDebug, metadata-only DebugRefs looked like pre-receive users and blocked that repair.

Include those DebugRefs in the same stable move set so default and GlobalDebug SSA retain identical runtime ordering.
@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 2, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

5336d7074219 | 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) 556.875 ms +35.1% (worse) 1.279 ms -17.6% (better)
Linux fmtprintf 5789416 B +161.5% (worse) 6.605 s +71.3% (worse) 2.656 ms -19.2% (better)
Linux println 687280 B +845.9% (worse) 564.944 ms +41.2% (worse) 1.618 ms -3.3% (better)
macOS cprintf 50784 B -40.0% (better) 555.806 ms +34.1% (worse) 3.477 ms -3.1% (better)
macOS fmtprintf 2745456 B +17.0% (worse) 7.416 s +88.2% (worse) 22.982 ms -1.7% (better)
macOS println 110336 B -13.1% (better) 557.760 ms +34.5% (worse) 5.246 ms -27.7% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs main
Linux BenchmarkLookupPCRandom 13.420 ns/op -0.4% (better)
Linux BenchmarkMergeCompilerFlags 154.300 ns/op -0.1% (better)
Linux BenchmarkMergeLinkerFlags 96.170 ns/op -5.1% (better)
Linux BenchmarkChannelBuffered 33.380 ns/op -4.0% (better)
Linux BenchmarkChannelHandoff 28894 ns/op -9.8% (better)
Linux BenchmarkDefer 45.820 ns/op -18.6% (better)
Linux BenchmarkDirectCall 1.557 ns/op -0.4% (better)
Linux BenchmarkGlobalRead 1.869 ns/op +19.8% (worse)
Linux BenchmarkGlobalWrite 2.487 ns/op -0.3% (better)
Linux BenchmarkGoroutine 61095 ns/op -19.2% (better)
Linux BenchmarkInterfaceCall 9.349 ns/op +20.0% (worse)
Linux BenchmarkRuntimeGetG 2.180 ns/op -58.9% (better)
macOS BenchmarkLookupPCRandom 14.760 ns/op +18.6% (worse)
macOS BenchmarkMergeCompilerFlags 181.200 ns/op +45.5% (worse)
macOS BenchmarkMergeLinkerFlags 115.500 ns/op +66.5% (worse)
macOS BenchmarkChannelBuffered 29.160 ns/op +5.2% (worse)
macOS BenchmarkChannelHandoff 6765 ns/op -3.5% (better)
macOS BenchmarkDefer 41.380 ns/op +10.6% (worse)
macOS BenchmarkDirectCall 1.330 ns/op -8.5% (better)
macOS BenchmarkGlobalRead 1.184 ns/op -2.2% (better)
macOS BenchmarkGlobalWrite 1.266 ns/op -14.9% (better)
macOS BenchmarkGoroutine 45185 ns/op +42.7% (worse)
macOS BenchmarkInterfaceCall 6.860 ns/op +27.1% (worse)
macOS BenchmarkRuntimeGetG 2.897 ns/op +12.4% (worse)

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

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