Repository navigation
perf(size): precompute compressed ops manifest, drop runtime schemars, and tighten packaging - #537
Conversation
eric8810
left a comment
There was a problem hiding this comment.
实现验证很好:321,763B manifest/digest 与 base 完全一致,14 个 C export 可解析,快照/压缩体积和 tokio feature 集都对。请补:1) docs/rfc-0039-implementation.md 仍称 runtime manifest/schemars schema,需更新; 2) CI 增加 aimux-ops 默认(feature-off)测试,确保 snapshot-only 路径被覆盖; 3) CHANGELOG 标明 TypeRef::schema 公共字段移除。另实际 dylib 降幅是 -368,432B/-4.16%,请修正文案。
e7e9404 to
71bc3f0
Compare
|
@eric8810 感谢细致复测!4 项已全部在最新 commit
本地已重跑 |
|
已 approve,但合并前需要 rebase 到 master(#538 改了 op.rs/op.rs 周边,当前 CONFLICTING)。rebase 后 CI 绿我会直接合。 |
|
再提醒一下:这个 PR 已 approve,但还需要 rebase 到当前 master(707c591b),目前仍是 CONFLICTING。rebase 后 CI 绿我直接合。 |
|
@eric8810 已 rebase 到最新 本地验证全绿:
待 CI 绿后麻烦直接合入! |
71bc3f0 to
e252f3b
Compare
|
rebase 提醒 + 一个依赖:你当前 head 的 CI 只红 |
|
#542 已合入 master(8a5df14e),导出断言已是 16,UAF race 也修了。现在只差你 rebase 到 master;rebase 后 CI 应该全绿,我直接合。 |
All points in this review were addressed in later commits; current head re-reviewed and approved by eric8810. Dismissing my own stale review so only CI gates the merge.
|
master 现在是 178885a,CI 全绿。这个 PR 是最后一个等 rebase 的已 approve 项,麻烦 sync/rebase 一下,绿了我立刻合。 |
|
master 现在是 0.7.0(#546 已合并,v0.7.0 已发布)。你的分支落后 57 个 commit,直接冲突的文件: rebase 时请注意:
rebase 后 CI 绿我就合(进 0.7.1)。代码本身我已 approve。 |
e252f3b to
39637dc
Compare
|
@eric8810 已按要求 rebase 到最新 v0.7.0
本地验证全绿: |
eric8810
left a comment
There was a problem hiding this comment.
Rebase 到 0.7.0 master 后复核:diff 不动 version 行,CHANGELOG 条目落在新的 [Unreleased] 段,[0.7.0] 段未改;tokio feature 收窄和 miniz_oxide 快照路径与之前 approve 的版本一致。20/20 CI 绿。Approve,合入后进 0.7.1。
Summary
Zero-functionality-loss binary and package size reduction (all 55 providers, all modalities,
jsonschemavalidation,realtime/ws, all 14 C ABI exports, and byte-for-byte identical manifest JSON & digest2c06887e117851bc776b2ecf801caa23e82324d4b906b7764d7f6319a1577284preserved; root[profile.release]staysopt-level = "z"):schemars(aimux-ops,aimux-codegen,aimux-ffi,bindings/node,bindings/python)schemarsmanifest generation (generate_manifest()) andTypeRef::schemabehind the opt-inaimux-ops/runtime-manifestfeature (enabled byaimux-codegenandtype_schemastests).miniz_oxidezlib-9 snapshot (aimux-ops/src/manifest.json.zlib, 58,988 B vs 321,763 B raw JSON) and digest (aimux-ops/src/manifest.digest, 64 hex chars), allowing LTO + dead-code elimination to stripschemars'sJsonSchemamachinery from shipped native libraries.aimux_ops::manifest::manifest_json()and routedaimux_manifest_json/ Node / Python bindings directly to the cached canonical JSON string without an extra parse/re-serialize pass.aimux-codegengenerates and--checkdrift-checks bothaimux-ops/src/manifest.json.zlibandaimux-ops/src/manifest.digestagainst the liveschemarsgenerator (generate_manifest()).aimux-providers)aimux-providers/build.rsthat strips JSON whitespace outside strings into$OUT_DIR/provider_registry.min.json(57,044 → 43,369 B, −13,675 B) and$OUT_DIR/provider_aliases.min.json(2,215 → 1,969 B, −246 B) while keeping the source JSON files readable and compatible withsync_registry.py.tokiofeatures (Cargo.toml,bindings/node/Cargo.toml,bindings/python/Cargo.toml)features = ["full"]with the explicit subset used in the workspace (rt,rt-multi-thread,sync,time,macros,net,io-util,process)..github/workflows/release.yml,scripts/stage_release_assets.py)--compression-method deflated --compression-level 9on Python wheel release publishing viamaturin.stage_release_assets.pydirectory zipping (aimux_ffi.xcframework.zip) from default Deflate-6 (shutil.make_archive) to explicit Deflate-9 (zipfile.ZipFile(..., compresslevel=9)).docs/rfc-0039-implementation.mdto document the build-time precomputed manifest snapshot and opt-inruntime-manifestfeature.aimux-opsfeature-off clippy and test steps (--no-default-features) in.github/workflows/ci.ymlso the snapshot-only path is covered independently of workspace feature unification.aimux_ops::op::TypeRef::schemafrom default builds underCHANGELOG.md(Unreleased/Breaking).Measured Size Delta (
aarch64-apple-darwin,release,opt-level = "z")libaimux_ffi.dylibdelta: −368,432 B (−4.16%) (16 KiB arm64 page-alignment difference vs local MacOSX26.5 SDK build below).585fb9990, local SDK)opt-level = "z")libaimux_ffi.dylib(raw, reviewer-verified)libaimux_ffi.dylib(gzip -9, local SDK)__TEXT.__text(local SDK)__TEXT.__const(local SDK)__DATA_CONST.__const(local SDK)__LINKEDIT(local SDK)Verification
cargo fmt --all -- --checkcargo clippy -p aimux-ops -p aimux-ffi --no-default-features --all-targets -- -D warnings(snapshot-only default path)cargo clippy --workspace --all-targets -- -D warningscargo run -p aimux-codegen -- --checkcargo test -p aimux-ops --no-default-features(standalone snapshot-only path) &cargo test -p aimux-ops --features runtime-manifest(liveschemars+ byte-for-byte snapshot equality +type_schemas)cargo test -p aimux-ffi,cargo test -p aimux-codegen,cargo test -p aimux-providers --lib preset::tests,cargo test -p aimux-providers --lib catalogue::tests,cargo test -p aimux-core --libcargo check --manifest-path bindings/node/Cargo.toml&cargo check --manifest-path bindings/python/Cargo.tomlctypessmoke test against releaselibaimux_ffi.dylib: verified all 14 C exports,aimux_abi_version() == 65536,aimux_manifest_json()exact 321,763 B / 72 ops / 328 packages / digest2c06887e117851bc776b2ecf801caa23e82324d4b906b7764d7f6319a1577284,runtime.describe, and presetprovider.create("abacus")bash scripts/check_provider_boundaries.sh,python3 scripts/check_layout.py,python3 -m unittest discover -s scripts/tests -p 'test_*.py'(63/63),python3 scripts/sync_registry.py --check --source models-dev --snapshot registry/models_dev_snapshot.jsoncargo package --list -p aimux-ops --allow-dirty&-p aimux-providers --allow-dirtyverified snapshot files andbuild.rsare included