Skip to content

[Based on #2098] runtime,test: complete Go 1.26 standard-library coverage#2134

Open
cpunion wants to merge 21 commits into
xgo-dev:mainfrom
cpunion:codex/go126-stdlib-coverage
Open

[Based on #2098] runtime,test: complete Go 1.26 standard-library coverage#2134
cpunion wants to merge 21 commits into
xgo-dev:mainfrom
cpunion:codex/go126-stdlib-coverage

Conversation

@cpunion

@cpunion cpunion commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Go 1.26 upgrade added packages and exported APIs that were not all represented by test/std. The coverage job only checked packages that already had a test directory, so a missing public package was invisible. Executable-only tests also did not prove that standard-library code initialized and ran correctly from c-shared and c-archive C consumers.

Fix

  • require a test/std package for every public package reported by exact Go 1.26.5 (176/176)
  • keep the existing full exported-identifier checker unchanged; runtime retains its existing exception and is covered by real runtime tests
  • add functional tests for the missing packages and newly exposed APIs, including HPKE, ML-KEM helpers, runtime/cgo.Handle, runtime/debug operations, plugin failure behavior, and testing/synctest
  • add the minimal Go 1.26 runtime bridges exposed by those tests without duplicating runtime,cl: add Go-compatible sampled memory profiling #2027's memory-profile work
  • teach llgo test -c to produce runnable c-shared and c-archive test libraries
  • run every test/std package as an executable on the existing Linux/macOS Go 1.26.5 matrix, and additionally run every package through real C shared/static consumers on Ubuntu

The new tests call APIs and assert results; they do not use _ = pkg.Symbol as a substitute for behavior coverage. Exported-symbol completeness remains a separate compile-time invariant.

Dependencies

This PR is based on #2098, which is based on #2090 and #2079. After those merge, the effective changes for this PR are the four commits after f8e826038.

Local validation

  • macOS arm64 / Go 1.26.5: all 17 changed test/std packages pass as executables, c-shared, and c-archive
  • Linux amd64 / Go 1.26.5: the same executable/shared/static execution matrix passes
  • macOS and Linux: public package coverage 176/176; all exported identifiers pass the unchanged checker (except the intentional runtime exclusion)
  • cmd/internal/test: 72.8% statement coverage
  • internal/build: 73.7% statement coverage
  • git diff --check and Go formatting pass

Follow-up to #2088 and #2108.

cpunion added 21 commits July 20, 2026 12:09
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.
Provide the synctest, Darwin CPU, Linux gettimeofday, and all-thread syscall hooks required by Go 1.26 standard-library code in c-shared and c-archive builds. Extend the export demo so C consumers link and execute fmt, goroutine, syscall, funcinfo, and explicit DWARF paths in both library modes.
@cpunion
cpunion force-pushed the codex/go126-stdlib-coverage branch from 29fc165 to ceee7f1 Compare July 20, 2026 08:56
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cpunion cpunion added go1.26 Go 1.26 compatibility and support go-test-compat Go standard-library and GOROOT test compatibility labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go1.26 Go 1.26 compatibility and support go-test-compat Go standard-library and GOROOT test compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant