From 1634bb42ca2d454b9647615e435a74d825c61ec9 Mon Sep 17 00:00:00 2001 From: MediaCrawler User Date: Tue, 30 Jun 2026 21:31:58 +0800 Subject: [PATCH] Reduce NVIDIA portable package size --- .github/workflows/release.yml | 13 +- docs/NVIDIA_RELEASE.md | 4 + docs/RELEASE_NOTES_v0.4.16.md | 152 ++++++++++++++++++++++++ package.json | 19 +-- scripts/check_nvidia_release_assets.mjs | 21 ++++ scripts/write_lite_builder_config.mjs | 2 +- tests/nvidia-release-contract.test.mjs | 15 +++ 7 files changed, 216 insertions(+), 10 deletions(-) create mode 100644 docs/RELEASE_NOTES_v0.4.16.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0f1d23..7ff1f4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -675,14 +675,25 @@ jobs: $unpackedDir = Join-Path $releaseDir "win-unpacked" if (-not $installer) { throw "Missing NVIDIA installer EXE before rename." } if (-not (Test-Path $unpackedDir)) { throw "Missing win-unpacked directory for NVIDIA portable recompression." } + $duplicatedKatagoDir = Join-Path $unpackedDir "resources/app.asar.unpacked/data/katago" + if (Test-Path $duplicatedKatagoDir) { + $duplicatedKatagoBytes = (Get-ChildItem -Path $duplicatedKatagoDir -Recurse -File | Measure-Object -Property Length -Sum).Sum + if ($duplicatedKatagoBytes -gt 1048576) { + throw "NVIDIA package duplicated KataGo assets inside app.asar.unpacked: $duplicatedKatagoBytes bytes" + } + } Push-Location $releaseDir - & 7z a -t7z -m0=LZMA2 -mx=1 -ms=off -mmt=on -v1900m "GoAgent-$version-win-x64-nvidia-portable.7z" ".\win-unpacked\*" | Out-Host + & 7z a -t7z -m0=LZMA2 -mx=7 -mmt=on -v1900m "GoAgent-$version-win-x64-nvidia-portable.7z" ".\win-unpacked\*" | Out-Host Pop-Location Rename-Item -LiteralPath $installer.FullName -NewName "GoAgent-$version-win-x64-nvidia.exe" -Force $nvidiaPortableParts = Get-ChildItem -Path $releaseDir -Filter "GoAgent-$version-win-x64-nvidia-portable.7z.*" -File | Sort-Object Name $nvidiaInstaller = Get-Item (Join-Path $releaseDir "GoAgent-$version-win-x64-nvidia.exe") if (-not $nvidiaPortableParts) { throw "Missing NVIDIA portable split 7z parts after recompression." } $nvidiaPortableTotal = ($nvidiaPortableParts | Measure-Object -Property Length -Sum).Sum + $nvidiaPortableMax = 2560MB + if ($nvidiaPortableTotal -gt $nvidiaPortableMax) { + throw "NVIDIA portable split 7z total bytes exceeds size budget: $nvidiaPortableTotal > $nvidiaPortableMax" + } Write-Host "NVIDIA portable split 7z parts: $($nvidiaPortableParts.Count)" Write-Host "NVIDIA portable split 7z total bytes: $nvidiaPortableTotal" Write-Host "NVIDIA installer EXE bytes: $($nvidiaInstaller.Length)" diff --git a/docs/NVIDIA_RELEASE.md b/docs/NVIDIA_RELEASE.md index ad7af46..9beb0cc 100644 --- a/docs/NVIDIA_RELEASE.md +++ b/docs/NVIDIA_RELEASE.md @@ -24,6 +24,8 @@ The NVIDIA edition is not a renamed standard package. During packaging, the work This matters because CUDA builds normally need neighboring DLL/runtime files next to `katago.exe`. +KataGo assets must live in `resources/data/katago` in the packaged app. They must not also appear under `resources/app.asar.unpacked/data/katago`; that duplicate path makes the portable archive dramatically larger without improving runtime behavior. + ## Expected Artifacts ```text @@ -33,6 +35,8 @@ GoAgent--win-x64-nvidia-portable.7z.002 GoAgent--win-x64-nvidia-portable.7z.003 ``` +The portable package is split only when needed for GitHub's per-asset upload limits. The workflow uses solid 7z compression and enforces a size budget so the total NVIDIA portable archive remains in the same order of magnitude as the source NVIDIA runtime bundle. + The standard Windows package remains: ```text diff --git a/docs/RELEASE_NOTES_v0.4.16.md b/docs/RELEASE_NOTES_v0.4.16.md new file mode 100644 index 0000000..3897457 --- /dev/null +++ b/docs/RELEASE_NOTES_v0.4.16.md @@ -0,0 +1,152 @@ +# GoAgent v0.4.16 + +GoAgent v0.4.16 is a Windows NVIDIA portable size hotfix. It removes duplicated KataGo assets from packaged app internals, restores solid 7z compression for the NVIDIA portable package, and adds release gates so the NVIDIA portable archive cannot silently grow far beyond the source NVIDIA runtime again. + +QQ 群:1030632742,欢迎一起交流、提建议、完善 GoAgent。 + +## v0.4 系列延续能力 + +This release keeps the broader v0.4 foundation: grounded shape recognition engine, local pattern matcher, knowledge source-policy gates, optimized move-range review, quality checks and eval gates, Real Eval / engine silver fixture gate, KataGo engine pool telemetry, Release artifact smoke, student level, student age, teacher persona style settings with evidence boundary, teacher sessions, selective PR #6 integration, Tool-first Agent runtime, Kokoro selected-provider TTS with offline synthesis, Windows OpenCL runtime bundle, KataGo OpenCL adjacent runtime files, GPU vendor OpenCL drivers, and the community contribution path from layiku and wimi321. + +## 中文 + +### 下载前先选版本 + +| 平台 / 场景 | 推荐下载 | +| --- | --- | +| macOS Apple Silicon(M 系列) | GoAgent-0.4.16-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.16-mac-x64.dmg | +| Windows x64 安装版,普通用户推荐 | GoAgent-0.4.16-win-x64.exe | +| Windows x64 免安装版 | GoAgent-0.4.16-win-x64-portable.zip | +| Windows x64 NVIDIA 专版安装版 | GoAgent-0.4.16-win-x64-nvidia.exe | +| Windows x64 NVIDIA 专版免安装包 | GoAgent-0.4.16-win-x64-nvidia-portable.7z.001 and all following split parts | +| 校验文件 | SHA256SUMS.txt | + +### 本版重点 + +- 修复 NVIDIA 免安装包把 KataGo runtime / 模型同时放进 `resources/data/katago` 和 `resources/app.asar.unpacked/data/katago` 的重复打包问题。 +- NVIDIA 免安装包恢复 solid 7z 压缩,并提高压缩等级,避免重复大文件把分卷包撑到异常体积。 +- Release workflow 增加 NVIDIA 体积预算,超过预算会直接失败,不再把异常大包发布给用户。 +- Windows Standard / Lite / NVIDIA packaged smoke 继续在上传前执行。 +- 安装版、Lite 包、标准包命名保持不变。 + +## 繁體中文 + +### 下載前先選版本 + +| 平台 / 使用情境 | 建議下載 | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.16-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.16-mac-x64.dmg | +| Windows x64 安裝版 | GoAgent-0.4.16-win-x64.exe | +| Windows x64 免安裝版 | GoAgent-0.4.16-win-x64-portable.zip | +| Windows x64 NVIDIA 專版 | GoAgent-0.4.16-win-x64-nvidia.exe | +| Windows x64 NVIDIA 免安裝包 | GoAgent-0.4.16-win-x64-nvidia-portable.7z.001 and all following split parts | +| 校驗檔 | SHA256SUMS.txt | + +### 本版重點 + +- 修復 NVIDIA 免安裝包重複放入 KataGo runtime / 模型的問題。 +- NVIDIA portable 改回 solid 7z 壓縮,並加入體積預算 gate。 +- Standard、Lite、NVIDIA Windows 包仍會在上傳前 smoke 啟動。 + +## English + +### Pick the right package before downloading + +| Platform / use case | Recommended download | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.16-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.16-mac-x64.dmg | +| Windows x64 installer | GoAgent-0.4.16-win-x64.exe | +| Windows x64 portable ZIP | GoAgent-0.4.16-win-x64-portable.zip | +| Windows x64 NVIDIA installer | GoAgent-0.4.16-win-x64-nvidia.exe | +| Windows x64 NVIDIA portable package | GoAgent-0.4.16-win-x64-nvidia-portable.7z.001 and all following split parts | +| Checksums | SHA256SUMS.txt | + +### Highlights + +- Fixes NVIDIA portable packages duplicating KataGo runtime/model files under both `resources/data/katago` and `resources/app.asar.unpacked/data/katago`. +- Restores solid 7z compression for the NVIDIA portable archive and raises the compression level. +- Adds a release size budget so an oversized NVIDIA portable package fails CI before publication. +- Keeps Standard, Lite, and NVIDIA Windows packaged-app smoke checks before artifact upload. + +## 日本語 + +### ダウンロード前に選ぶもの + +| 環境 | 推奨ファイル | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.16-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.16-mac-x64.dmg | +| Windows x64 インストーラー | GoAgent-0.4.16-win-x64.exe | +| Windows x64 ポータブル ZIP | GoAgent-0.4.16-win-x64-portable.zip | +| Windows x64 NVIDIA 版 | GoAgent-0.4.16-win-x64-nvidia.exe | +| Windows x64 NVIDIA ポータブル | GoAgent-0.4.16-win-x64-nvidia-portable.7z.001 and all following split parts | +| チェックサム | SHA256SUMS.txt | + +### 主な変更 + +- NVIDIA ポータブル版で KataGo runtime / model が重複して入る問題を修正しました。 +- NVIDIA portable は solid 7z 圧縮を使い、サイズ予算 gate で肥大化を防ぎます。 +- Windows packaged smoke は Standard / Lite / NVIDIA のすべてで継続します。 + +## 한국어 + +### 다운로드 전 선택 + +| 환경 | 권장 다운로드 | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.16-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.16-mac-x64.dmg | +| Windows x64 설치 프로그램 | GoAgent-0.4.16-win-x64.exe | +| Windows x64 포터블 ZIP | GoAgent-0.4.16-win-x64-portable.zip | +| Windows x64 NVIDIA 설치 프로그램 | GoAgent-0.4.16-win-x64-nvidia.exe | +| Windows x64 NVIDIA 포터블 | GoAgent-0.4.16-win-x64-nvidia-portable.7z.001 and all following split parts | +| 체크섬 | SHA256SUMS.txt | + +### 이번 버전 + +- NVIDIA 포터블 패키지에 KataGo runtime / model이 중복 포함되던 문제를 수정했습니다. +- solid 7z 압축과 크기 예산 gate를 추가했습니다. +- Windows Standard / Lite / NVIDIA smoke 검사는 계속 실행됩니다. + +## ภาษาไทย + +### เลือกไฟล์ก่อนดาวน์โหลด + +| แพลตฟอร์ม | ไฟล์ที่แนะนำ | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.16-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.16-mac-x64.dmg | +| Windows x64 installer | GoAgent-0.4.16-win-x64.exe | +| Windows x64 portable ZIP | GoAgent-0.4.16-win-x64-portable.zip | +| Windows x64 NVIDIA installer | GoAgent-0.4.16-win-x64-nvidia.exe | +| Windows x64 NVIDIA portable | GoAgent-0.4.16-win-x64-nvidia-portable.7z.001 and all following split parts | +| Checksums | SHA256SUMS.txt | + +### จุดสำคัญของรุ่นนี้ + +- แก้ปัญหา NVIDIA portable ใส่ KataGo runtime / model ซ้ำ +- เปิด solid 7z compression และเพิ่ม size budget gate +- ยัง smoke-start แพ็กเกจ Windows Standard / Lite / NVIDIA ก่อนอัปโหลด + +## Tiếng Việt + +### Chọn gói tải xuống + +| Nền tảng | Gói khuyến nghị | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.16-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.16-mac-x64.dmg | +| Windows x64 installer | GoAgent-0.4.16-win-x64.exe | +| Windows x64 portable ZIP | GoAgent-0.4.16-win-x64-portable.zip | +| Windows x64 NVIDIA installer | GoAgent-0.4.16-win-x64-nvidia.exe | +| Windows x64 NVIDIA portable | GoAgent-0.4.16-win-x64-nvidia-portable.7z.001 and all following split parts | +| Checksums | SHA256SUMS.txt | + +### Điểm mới + +- Sửa lỗi NVIDIA portable chứa trùng KataGo runtime / model. +- Bật solid 7z compression và thêm size budget gate. +- Tiếp tục smoke-start các gói Windows Standard / Lite / NVIDIA trước khi upload. diff --git a/package.json b/package.json index 668036a..139de6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "goagent", - "version": "0.4.15", + "version": "0.4.16", "description": "Agentic AI teacher for Go / Weiqi / Baduk, powered by KataGo and multimodal LLMs.", "main": "out/main/index.js", "type": "module", @@ -116,9 +116,8 @@ "files": [ "out/**/*", "scripts/**/*", - "data/**/*", - "!data/katago/bin/**/*", - "!data/katago/models/**/*", + "data/knowledge/**/*", + "!data/katago/**/*", "!data/tts/**/*", "assets/**/*", "package.json" @@ -140,10 +139,7 @@ ] } ], - "asarUnpack": [ - "data/katago/**/*", - "data/tts/**/*" - ], + "asarUnpack": [], "asar": true, "mac": { "category": "public.app-category.education", @@ -174,6 +170,13 @@ "icon": "assets/icon.ico", "artifactName": "${productName}-${version}-${os}-${arch}-portable.${ext}", "files": [ + "out/**/*", + "scripts/**/*", + "data/knowledge/**/*", + "!data/katago/**/*", + "!data/tts/**/*", + "assets/**/*", + "package.json", "!**/node_modules/onnxruntime-node/bin/napi-v3/darwin/**", "!**/node_modules/onnxruntime-node/bin/napi-v3/linux/**", "!**/node_modules/onnxruntime-node/bin/napi-v3/win32/arm64/**", diff --git a/scripts/check_nvidia_release_assets.mjs b/scripts/check_nvidia_release_assets.mjs index d92a183..9f34864 100644 --- a/scripts/check_nvidia_release_assets.mjs +++ b/scripts/check_nvidia_release_assets.mjs @@ -32,6 +32,11 @@ const requiredWorkflowFragments = [ '--platform=darwin-arm64', '--platform=darwin-x64', 'hdiutil attach', + 'resources/app.asar.unpacked/data/katago', + 'NVIDIA package duplicated KataGo assets', + '-mx=7', + '$nvidiaPortableMax = 2560MB', + 'NVIDIA portable split 7z total bytes exceeds size budget', 'body_path: docs/RELEASE_NOTES_${{ github.ref_name }}.md' ] @@ -59,6 +64,22 @@ for (const scriptName of requiredScripts) { if (!packageJson.scripts?.[scriptName]) failures.push(`package.json missing script: ${scriptName}`) } +const buildFiles = packageJson.build?.files ?? [] +const winFiles = packageJson.build?.win?.files ?? [] +const asarUnpack = packageJson.build?.asarUnpack ?? [] +for (const [label, files] of [['build.files', buildFiles], ['build.win.files', winFiles]]) { + if (!files.includes('data/knowledge/**/*')) failures.push(`${label} must include data/knowledge/**/* explicitly`) + if (!files.includes('!data/katago/**/*')) failures.push(`${label} must exclude data/katago/**/* from app.asar`) + if (!files.includes('!data/tts/**/*')) failures.push(`${label} must exclude data/tts/**/* from app.asar`) + if (files.includes('data/**/*')) failures.push(`${label} must not include broad data/**/* because it duplicates extraResources`) +} +if (asarUnpack.some((entry) => /data\/(?:katago|tts)/.test(String(entry)))) { + failures.push('build.asarUnpack must not unpack data/katago or data/tts because they are shipped via extraResources') +} +if (workflow.includes('-ms=off')) { + failures.push('NVIDIA portable compression must not disable solid compression with -ms=off') +} + if (failures.length > 0) { for (const failure of failures) console.error(`[check-nvidia-release-assets] ${failure}`) process.exit(1) diff --git a/scripts/write_lite_builder_config.mjs b/scripts/write_lite_builder_config.mjs index 02556b3..33038cc 100644 --- a/scripts/write_lite_builder_config.mjs +++ b/scripts/write_lite_builder_config.mjs @@ -30,7 +30,7 @@ liteBuild.extraResources = [ filter: ['**/*', '!kokoro/zh-CN/onnx/model_int8.onnx'] } ] -liteBuild.asarUnpack = ['data/tts/**/*'] +liteBuild.asarUnpack = [] liteBuild.win = { ...(liteBuild.win ?? {}), diff --git a/tests/nvidia-release-contract.test.mjs b/tests/nvidia-release-contract.test.mjs index dc73b0d..757bbcb 100644 --- a/tests/nvidia-release-contract.test.mjs +++ b/tests/nvidia-release-contract.test.mjs @@ -22,6 +22,7 @@ test('release workflow publishes standard Windows as a full OpenCL runtime bundl test('release workflow publishes a real Windows NVIDIA edition', () => { const workflow = readFileSync(join(root, '.github', 'workflows', 'release.yml'), 'utf8') + const packageJson = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) assert.match(workflow, /package-nvidia-windows:/) assert.match(workflow, /wimi321\/lizzieyzy-next/) @@ -31,6 +32,20 @@ test('release workflow publishes a real Windows NVIDIA edition', () => { assert.match(workflow, /RUNNER_OS.*Windows/) assert.match(workflow, /GoAgent-\*-win-x64-nvidia-portable\.7z\*/) assert.match(workflow, /GoAgent-\*-win-x64-nvidia\.exe/) + assert.match(workflow, /resources\/app\.asar\.unpacked\/data\/katago/) + assert.match(workflow, /NVIDIA package duplicated KataGo assets/) + assert.match(workflow, /-mx=7/) + assert.doesNotMatch(workflow, /-ms=off/) + assert.match(workflow, /\$nvidiaPortableMax = 2560MB/) + assert.match(workflow, /NVIDIA portable split 7z total bytes exceeds size budget/) + + for (const files of [packageJson.build.files, packageJson.build.win.files]) { + assert.ok(files.includes('data/knowledge/**/*')) + assert.ok(files.includes('!data/katago/**/*')) + assert.ok(files.includes('!data/tts/**/*')) + assert.equal(files.includes('data/**/*'), false) + } + assert.deepEqual(packageJson.build.asarUnpack, []) }) test('release workflow restores macOS KataGo assets from macOS packages', () => {