Repository navigation
chore: update Go to 1.27.1 and refresh dependencies - #1
Merged
Merged
Conversation
go directive 1.26.4 -> 1.27.1; Docker builder images golang:1.26 -> golang:1.27. Direct deps: containernetworking/cni v1.3.1, ginkgo v2.33.0, gomega v1.44.0, x/sys v0.48.0 (yaml/v3 v3.0.5 indirect). golangci-lint v2.5.0 can't typecheck against 1.27 (its x/tools reads export data up to v2; 1.27 writes v4), so the pin moves to v2.14.0. That version flags three goconst/prealloc hits in perfrig tests; fixed with named constants for the fake substrate's call log and a preallocated slice. Claude-Session: https://claude.ai/code/session_01RyYnvjh5DBevutC4HTgELn
Go 1.27 made the CNI plugin's peak RSS per invocation ~465 KB larger (4817 -> 5282 KB, n=30, CNI_COMMAND=VERSION). About 290 KB of that is encoding/json now being backed by json/v2; the rest is stdlib code growth. Nearly all of it is file-backed text/rodata: a CNI call pages in ~85% of the binary, so RSS tracks binary size. This takes out more than that: - internal/cniskel: libcni's skel v1.3.1 with its name validators reimplemented without regexp. cni/pkg/utils compiles a regexp at init, which the linker can't drop; removing it saves ~350 KB of RSS. Upstream's skel tests run against the copy, and names_test.go checks the validators against the upstream regexp (table + fuzz). The copy is excluded from goconst/gocyclo so it stays diffable against upstream. - cmd/natra-tools: install-cni-chain, dump-stats and profile move to a sibling binary. `natra <subcommand>` execs it from the same directory, so the documented commands are unchanged. The installer DaemonSet and image ship both binaries. - The ADD-path heap-profile hook needs -tags heapprofile, so default builds don't link runtime/pprof. - cmd/natra/deps_test.go fails if regexp, runtime/pprof or libcni's skel/utils come back into the plugin. make test-unit and the CI unit job only covered ./pkg (and ./internal locally), so cmd/ and internal/ tests never ran in CI; both now run. Claude-Session: https://claude.ai/code/session_01RyYnvjh5DBevutC4HTgELn
terraboops
force-pushed
the
chore/deps-2026-09
branch
from
September 30, 2026 03:39
c8f7635 to
016cc07
Compare
Two gaps showed up on this PR's first gated run: - The main side was built with HEAD's Go (setup-go installs the toolchain from HEAD's go.mod, and main's older go line doesn't force its own), so a toolchain bump was never measured. bench-ab.sh now runs each side with GOTOOLCHAIN from that side's go.mod. - ParseBandwidthAnnotationJSON came out +0.65% (p<0.001) on code this PR doesn't touch, while a sibling run of the same commit showed no change: alignment/runner noise. scripts/bench-check.sh now runs a second full A/B when the first flags anything and fails only on benchmarks that regress in both, so a real regression of any size still fails. Claude-Session: https://claude.ai/code/session_01RyYnvjh5DBevutC4HTgELn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
go.mod, plusgolang:1.27in both Dockerfiles andscripts/run-in-docker.sh.export data version 4 is greater than maximum supported version 2. v2.14.0 flagged three goconst/prealloc hits in perfrig tests, which are now fixed.Go 1.27 made the CNI plugin use more memory, so this PR also slims the binary
Built from the same source, 1.27 grew the plugin's peak RSS per invocation by ~465 KB (4817 → 5282 KB; n=30,
CNI_COMMAND=VERSION, GNUtime -v):encoding/jsonnow being backed byencoding/json/v2: +220 KB of text, plus reflect/slices growth. WithGOEXPERIMENT=nojsonv2most of the gap goes away.Refactor, second commit:
internal/cniskel: libcni'sskelv1.3.1 with the name validators rewritten withoutregexp.cni/pkg/utilscompiles a regexp at init, so the linker can't drop it.cmd/natra-tools:install-cni-chain,dump-statsandprofilemove to a sibling binary.natra <subcommand>execs it from the same directory, so the documented commands are unchanged. The installer and image ship both binaries.-tags heapprofilecmd/natra/deps_test.gofails ifregexp,runtime/pprofor libcni's skel/utils come back into the pluginResult:
main4732.6 ± 8.1 KB vs this PR 4737.7 ± 8.0 KB (n=150 interleaved, standard error): parity. The plugin binary is 7.44 MB vs 7.48 MB. MeanwhileParseBandwidthAnnotationJSONis ~56% faster with 3 allocs instead of 10 (json/v2).cniskelequivalence: upstream's own skel test suite runs against the copy.names_test.gochecks all three validators againstcni/pkg/utils(same error code and message) and fuzzes the byte-loop matcher against the upstream regexp (738k execs, no mismatch).Also: CI's unit job ran only
./pkg/..., sointernal/andcmd/tests (e.g.cmd/natra/threshold_test.go) never ran in CI. Now./pkg/... ./internal/... ./cmd/....Testing
macOS/arm64 + colima, on the rebased branch:
make pre-push(fmt, vet, lint, unit incl. cmd/internal, fuzz)make test-cni(L2 CNI protocol, viainternal/cniskel)make test-bpf(L3)make test-perf(L5)make test-e2e(L4, k3d, installer runs forwardedinstall-cni-chain)make license-scan-fastinstall-cni-chainwrote the chained conflist;dump-statsreached natra-tools; symlinkednatra; missing natra-tools gives a clear errorFull-profile
perf-vs-vanillavs a freshmainbaseline is in progress and will be posted here before merge.https://claude.ai/code/session_01RyYnvjh5DBevutC4HTgELn