Repository navigation
perf: 复用冻结验证并聚合 Topology 诊断 - #515
Merged
Merged
Conversation
This was referenced Oct 28, 2026
Closed
Merged
Merged
Merged
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.
关联 Issue
Closes #514。
改了什么
含 Sub 的已封口图在重复 Validate/Start 时,原先会在包级装配锁内重建静态验证树;嵌套 Topology 又会在每层祖先重复诊断后代。本次复用冻结声明结构,每个 Topology 层的诊断只构建一次。
assemblyMu → graph.mu的检查与封口边界;失败不安装计划、不封口任何层。冻结调用只取根图锁。新增
私有验证计划与对应回归测试;无新增导出 API、公开包、依赖或调度器。
影响范围
运行语义保持兼容。没有 Durable 存储或 Provides 写权限优化。本 PR 是 v0.5.2 的兼容 patch 候选,标签/Release 发布须在维护者审阅和合并之后进行。
测试
Go 1.26.10、Windows/amd64;所有 Go 命令使用
GOWORK=off GOTOOLCHAIN=local。go build ./...、go vet ./...:通过。gofmt -l检查已跟踪与新增 Go 文件:输出为空。go list -deps -f '{{if not .Standard}}{{.ImportPath}}{{end}}' .:非标准库仅根 pulse 包。go test -race -count=1 -timeout=180s ./...:四包通过,根包 43.128s。go test -count=1 -run '^TestDocs(ExamplesUseCurrentSignatures|ExampleGateNegativeControls)$' .:通过。npm.cmd run build:通过,仅有既有打包体积提示。go test -race -count=3 -timeout=90s -v .通过:在同一冻结定义上交替 ready/skip、宿主登记、ExecAspects、额度 1/2/0、普通/checkpoint、恢复/新执行,并发 32 个不同值的 Sub 执行;探针在固定旧基线也通过。定向性能证据
同一公开 API 测量程序、机器与输入形状;基线
75f5de031101f51940caf61c8df281867dc81b7c对照本 PR 工作树候选。每组运行go test -run '^$' -bench 'Benchmark(Frozen|Topology)' -benchtime=10x -count=3 -cpu=4 .;基线通过-modfile=baseline.mod选择独立检出。以下为三次中位数,MB 为十进制。10 次迭代的 Validate 样本包含第一次模式求值。另跑预热
BenchmarkValidationPlanOrdinarySub/frozen,参数-benchtime=1s -count=3 -cpu=4,该合成普通 Sub 形状为 13.88–14.92 ns/op、0 B/op、0 allocs/op。Start 仅测包含 goroutine 创建的提交阶段,不含 NewExecution/Wait,不是整轮吞吐。首次冻结/模式建立、任意根 skip 仍有成本;Topology 完整路径和祖先链仍有深度相关字节成本。审查关注点
自审
已检查完整差异、冻结边界与兼容性;未提交凭据;实现契约与双语使用说明已同步。