Skip to content

go_language: the engine expands a package before importers share it (#bd31yd3) - #583

Merged
kirkouimet merged 4 commits into
mainfrom
train/engine-b
Dec 2, 2026
Merged

kirkouimet merged 4 commits into
mainfrom
train/engine-b

Conversation

@kirkouimet

Copy link
Copy Markdown
Member

Train of two accepted engine changes, each commit cherry-picked unchanged onto main, the tree equal to their chained merge: #558 (the reads golden writes a closure once where both reads agree, #wtsreqh) and #575 (the engine expands a package before importers share it, #bd31yd3). Carries #558 and #575.

kirkouimet and others added 3 commits December 2, 2026 09:34
reads_renderings.golden wrote each object's closure twice, measured
and whole, though most read alike (#wtsreqh). closureBlocks now
writes one block headed "measured and whole" where digest and lines
agree, and both where either differs, so the six objects a size moves
(Handle, NewStable, Stable, state, Named, Outer) stand out among the
15 that agree. The golden goes from 27,044 to 23,287 bytes, and
unfolding it gives back the old one byte for byte. A test drives a
digest and a line differing; folding on the digest alone reads red.
The engine's load races as go_types' did (#v42qbm3, #567): go/types
writes a lazily expanded instance's right-hand side under its lock
(named.go:244) while a checker's isComplete reads it unlocked
(cycles.go:122), and the load checks each package on its own goroutine
once its imports are done (loader.go:238, :266), so two importers of one
package share its instances side by side. A user's run could race.

The walk moves from go_types to internal/go_language/type_expansion, one
home for both loaders, and the load runs it at both hand-offs, before a
package's done closes: after its check from source, and after its export
data is read on the restored path. No check is serialized.

TestTwoImportersCheckedAtOnceShareNoInstanceLeftToExpand loads #567's
fixture through the engine twice, its dependency checked from source and
restored from export data, 20 rounds each, on load's race list. Each step
alone is red with its own walk off and green with the other's off.

Cold runs on Kirk's Mac, interleaved, at load 60 to 90: 33.4 to 36.2 s
against 32.8 to 35.8 s, no cost above that noise; a quiet pair and the
four-tree census are asked of codebase. load, go_types and guard pass.

Co-Authored-By: Ahra <ahra@ahra.ai>
The Go Square's pin on #571: the walk never stops at an instance, only at
another package's declared Named, and nothing held that. Both fixtures
gain mid, whose `var W dep.G[string]` is an instance mid's own checker
makes and no walk of dep sees; a and b read and range over mid.W.Clone()
as they do dep.F().Clone().

The Square's mutant, a foreign instance stopping the walk (the origin
check dropped from the stop), is red under -race in go_types' source test
and in both of the engine test's steps, each run alone. go_types and load
pass.

Co-Authored-By: Ahra <ahra@ahra.ai>
@system-loom

system-loom Bot commented Dec 2, 2026

Copy link
Copy Markdown

🔄 Integrating on Shackler, a Mac with an M3 Max (16 cores, 128 GB), macOS 27.2.1, Go 1.27.4, Swift 6.4.2, started at 11:09 AM MST, 53 seconds after it was queued.
J-q0ns645 · #bd31yd3

@system-loom

system-loom Bot commented Dec 2, 2026

Copy link
Copy Markdown

❌ Red at 11:35 AM MST: 1 test failed in github.com/system-inc/cohere/internal/testing/guard/file_size, after 26 minutes. Main is unchanged and the pull request left the queue.

First failure: TestEveryTestFileAndFixturePastItsLineIsListedWithItsReason at file_size_test.go:623

file_size_test.go:623: 1 test packages disagree with listedFixturePackages. Fixtures adding up past 50 KB ask the same question of their package, so cutting one into parts cannot quiet it: delete, cut or generate them, or list the package with the reason their size is the point:
      internal/go_language/check/testdata is listed in listedFixturePackages, but is gone or back under the line; remove its entry
This Pull Request Last Integration #580 (06d32347)
Run 26 minutes 4 minutes 53 seconds
Test Packages 282 ran, 189 from the cache, 1 failed. 10 ran, 460 from the cache.

Ran on Shackler, a Mac with an M3 Max (16 cores, 128 GB), macOS 27.2.1, Go 1.27.4, Swift 6.4.2, load 2.54 when it started · J-q0ns645 · #bd31yd3

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 2, 2026
#558 writes the reads golden's closure once where both reads agree, which takes internal/go_language/check/testdata back under 50 KB. The size guard (#573) then refuses its listedFixturePackages entry as stale, as it should (J-q0ns645), so the entry leaves.

Co-Authored-By: Ahra <ahra@ahra.ai>
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@system-loom

system-loom Bot commented Dec 2, 2026

Copy link
Copy Markdown

🔄 Integrating on Shackler, a Mac with an M3 Max (16 cores, 128 GB), macOS 27.2.1, Go 1.27.4, Swift 6.4.2, started at 1:39 PM MST, 58 seconds after it was queued.
J-wa9hfs9 · #bd31yd3

@system-loom

system-loom Bot commented Dec 2, 2026

Copy link
Copy Markdown

❌ Red at 1:54 PM MST: 1 test failed in github.com/system-inc/cohere/internal/go_language/load, after 14 minutes 40 seconds. Main is unchanged and the pull request left the queue.

First failure: TestACgoProjectsPackageIsRestoredFromExportData at cgo_translation_test.go:230
cgo_translation_test.go:230: reading CGO_ENABLED with go env: exit status 97

This Pull Request Last Integration #592 (7aa93a25)
Run 14 minutes 40 seconds 10 minutes 50 seconds
Test Packages 20 ran, 449 from the cache. 11 ran, 461 from the cache.
Under the Race Detector 1 ran, 0 from the cache. 1 ran, 21 from the cache.

Ran on Shackler, a Mac with an M3 Max (16 cores, 128 GB), macOS 27.2.1, Go 1.27.4, Swift 6.4.2, load 1.81 when it started · J-wa9hfs9 · #bd31yd3

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@kirkouimet
kirkouimet removed this pull request from the merge queue due to a manual request Dec 2, 2026
@kirkouimet
kirkouimet added this pull request to the merge queue Dec 2, 2026
@system-loom

system-loom Bot commented Dec 2, 2026

Copy link
Copy Markdown

🔄 Integrating on Shackler, a Mac with an M3 Max (16 cores, 128 GB), macOS 27.2.1, Go 1.27.4, Swift 6.4.2, started at 2:57 PM MST, 58 seconds after it was queued.
J-9sebf27 · #bd31yd3

Merged via the queue into main with commit c859257 Dec 2, 2026
1 check passed
@system-loom

system-loom Bot commented Dec 2, 2026

Copy link
Copy Markdown

✅ Integrated onto main at 3:29 PM MST, 32 minutes 21 seconds after it was queued, 7 minutes 26 seconds slower than the last one, #599 (19d6c50c): 25 test packages ran, against 21.

This Pull Request Last Integration #599 (19d6c50c)
Run 30 minutes 23 seconds 22 minutes 32 seconds
Test Packages 25 ran, 447 from the cache. 21 ran, 451 from the cache.
Under the Race Detector 6 ran, 16 from the cache. 5 ran, 17 from the cache.
Performance Against #590 (c3f2452d): cold root 7.43 seconds to 4.77 seconds, 35.8% faster; cold deeafbf 4.14 seconds to 2.86 seconds, 30.9% faster; warm root 1.1 seconds to 0.94 seconds, 14.5% faster.
Step This Pull Request Last Integration #599 (19d6c50c)
Preflight 0.2 seconds 0.2 seconds
Checkout Code 6.6 seconds 6.6 seconds
Build 16.9 seconds 10.4 seconds
Measure 2 minutes 8 seconds Skipped
Tests 25 minutes 33 seconds 20 minutes 1 second
↳ Plain 1 minute 23 seconds 1 minute 33 seconds
↳ Shards 7 minutes 52 seconds 3 minutes 27 seconds
↳ Race 6 minutes 20 seconds 5 minutes 5 seconds
↳ Box 9 minutes 58 seconds 9 minutes 56 seconds
Verify 1 minute 46 seconds 44.2 seconds
↳ Go Vet 3.7 seconds 3.6 seconds
↳ Rule CPU 5.1 seconds 5.1 seconds
↳ Documentation 22.7 seconds 21.4 seconds
↳ Build 6.5 seconds 6.6 seconds
↳ Isolation 51 seconds
↳ Self-check 16.8 seconds 6.9 seconds
↳ ↳ Root (side by side) 15.9 seconds 6.1 seconds
↳ ↳ swift_language (side by side) 0.6 seconds 0.6 seconds
↳ ↳ Format (side by side) 0.3 seconds 0.3 seconds

Slowest Tests

Test packages: 25 ran, 447 replayed. Under the race detector: 6 ran, 16 replayed.

Package This Pull Request Last Integration #599 (19d6c50c) Why It Ran
github.com/system-inc/cohere/internal/front_door (shard 1 of 3) 3 minutes 59 seconds Replayed its test binary changed: its own code or a package it imports
↳ TestASwiftRunInAWorktreeMissesOnAGitAddForceOfAFileOnlyItsSharedExcludeIgnores 3 minutes 50 seconds
github.com/system-inc/cohere/internal/go_language/load 3 minutes 32 seconds 3 minutes 35 seconds its test binary changed: its own code or a package it imports
↳ TestEveryReaderOfCoheresGoFilesReadsOnlyTheirHeaders 2 minutes 51 seconds
github.com/system-inc/cohere/internal/go_language (shard 2 of 8) 3 minutes 19 seconds 3 minutes 20 seconds its test binary changed: its own code or a package it imports
github.com/system-inc/cohere/internal/go_language (shard 8 of 8) 2 minutes 52 seconds 2 minutes 54 seconds its test binary changed: its own code or a package it imports
github.com/system-inc/cohere/internal/go_language (shard 5 of 8) 2 minutes 45 seconds 2 minutes 48 seconds its test binary changed: its own code or a package it imports
github.com/system-inc/cohere/internal/go_language (shard 7 of 8) 2 minutes 44 seconds 2 minutes 47 seconds its test binary changed: its own code or a package it imports
github.com/system-inc/cohere/internal/go_language (shard 1 of 8) 2 minutes 42 seconds 2 minutes 46 seconds its test binary changed: its own code or a package it imports
github.com/system-inc/cohere/command/cohere-dev (race) 2 minutes 23 seconds 2 minutes 30 seconds its test binary changed: its own code or a package it imports
github.com/system-inc/cohere/internal/go_language (shard 4 of 8) 2 minutes 5 seconds 2 minutes 7 seconds its test binary changed: its own code or a package it imports
github.com/system-inc/cohere/internal/go_language (race) 2 minutes 5 seconds 2 minutes 8 seconds its test binary changed: its own code or a package it imports

Integrated on Shackler, a Mac with an M3 Max (16 cores, 128 GB), macOS 27.2.1, Go 1.27.4, Swift 6.4.2, load 3.9 when it started · J-9sebf27 · #bd31yd3

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