Repository navigation
feat(desktop): 状态栏内存详情显示压缩/换出、显存与 CPU、GPU 占用 - #1933
Merged
Merged
Conversation
- 三端统一记录“内存中”和“压缩/换出”:macOS 为物理占用减压缩量与压缩量,Windows 为专用工作集与私有提交减专用工作集(上限值),Linux 为常驻减共享与 VmSwap - sysinfo 进程表新增累计 CPU 时间;Windows 通过 D3DKMT 读专用显存和各 GPU 引擎忙碌时间,只在详情打开时读取主进程和上次读数里的进程 - 采样带单调时钟的 sampledAt,Core 返回的基线下次原样带回,由 Core 计算 CPU、GPU 百分比;Windows 按全部逻辑处理器折算 - 详情弹窗新增统计行(压缩/换出、显存、CPU、GPU)和 CPU、GPU、内存中、压缩/换出四列,没有数据的项与列不显示;弹窗加宽到 540 - 补齐中英词条,更新 ⓘ 说明、截图与功能矩阵;固定 Core 到 Lithe-core-rust#45 的 c7213c2
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 15:57
Lithe Review结论: ❓ 审查未完成 已由服务器取消。可以重新评论 |
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 / Linked issue
submit-lithe-issue的规则,开发请求不等于授权建单,所以没有单独建,需要时可以补建。40711b1)PR 类型 / Type
改动说明 / What changes
背景 / Why
状态栏内存详情原来只显示一个数:macOS 是物理占用,Windows 是专用工作集。在 Windows 上 Lithe 看起来只占 108 MB,用户以为漏算了。实际上没有漏算,只是被系统压缩或换出的内存、Windows 的专用显存都不在这个数里;详情里也看不到 CPU 和 GPU 占用。
这次三端按同一种方式记录两个量:“内存中”是实际在内存里的部分,“压缩/换出”是被系统压缩或写到磁盘的部分。另外补上 GPU 显存和 CPU、GPU 占用。
改动 / Changes
读数(
desktop/internal/sysinfo/)Process新增三个可选字段:CompressedBytes:压缩或换出的部分,MemoryBytes不包含它。GPUMemoryBytes:MemoryBytes不包含的显存。CPUTime:累计 CPU 时间,单位微秒。还新增了
GPUEngines,即各 GPU 引擎的累计忙碌时间。Options.GPU指定只为哪些进程读 GPU。各平台读取方式:
process_darwin.go)ri_phys_footprint减TASK_VM_INFO.compressedcompressedri_user_time + ri_system_timeaccumulatedGPUTimeprocess_windows.go、新文件gpu_windows.go)PrivateUsage减专用工作集。这是上限值,包含已提交但还没碰过的页GetProcessTimesRunningTimeprocess_linux.go)/proc/<pid>/status的VmSwap/proc/<pid>/stat的 utime + stime读不到的字段留空,不当作 0。新增
process_linux_test.go,覆盖 status 与 stat 的解析。汇总(
desktop/internal/core/process_memory.go)SampledAt、Previous、LogicalProcessors,以及各层可选的压缩、显存、CPU、GPU 和Baseline。采样与呈现(
desktop/internal/workbench/memory_monitor.go)SampledAt,取memoryEpoch起算的单调时钟微秒。上一次响应的Baseline作为Previous原样带回,百分比由 Core 计算。LogicalProcessors = runtime.NumCPU(),CPU 是占全部核心的比例,和任务管理器一致。macOS 按单核计,和活动监视器一致。文案(
shared/i18n/)helpFigurescolumnCPU、columnGPU、columnInMemory、columnCompressedstatCompressed、statGPUMemory、statCPU、statGPU、statSeparatorpercenthelpMacOS、helpWindows、helpLinux,重新生成shared.generated.go。测试、截图与其他
memory_monitor_test.go:process_test.go同步新字段。docs/assets/memory-details/的四张截图重新生成,README 同步说明。memory-monitor.json:gpu_windows.go。pending。scripts/desktop/build-desktop-core.sh:PINNED_CORE_REVISION升到 Core main 的40711b1(fix(search): restore Search Everywhere scrolling #45 加 [Bug] 双Shift搜索列表无法下拉 #44),历史注释同步说明 [Feature] 关闭项目类似IDEA一样 回退到欢迎页面 #43、[Bug] 双Shift搜索列表无法下拉 #44、fix(search): restore Search Everywhere scrolling #45 已 squash 合入。合并 preview 时这里和 feat(desktop): Run 窗口按 IDEA 样式为每次执行开标签,控制台按 ANSI 转义着色 #1932 冲突:两边改的 Core [Bug] 双Shift搜索列表无法下拉 #44、fix(search): restore Search Everywhere scrolling #45 都已合入,40711b1正好是 fix(search): restore Search Everywhere scrolling #45 测过的c7213c2加上 [Bug] 双Shift搜索列表无法下拉 #44 的改动。截图(深色中文 / 浅色英文):
不在本 PR 范围内 / Out of scope
PINNED_CORE_REVISION已改为 main 上的 commit。类型专属:feat
多平台对齐
platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/memory-monitor.json:两端的实现状态和验证状态、证据路径、owner、验证动作都如实填写;没有运行验证的保持pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh;改了平台实现路径的,还运行了./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空shared/i18n/;插件的构建步骤、资源路径和补丁没有写进scripts/resources/、docs/ci-builds.md、Agent Note 或 Skill统一日志系统 / Structured logging
N/A:没有新增或改动生命周期里程碑、用户操作终态或失败路径的日志;读数失败沿用原有的“无法读取”呈现。
界面文案 / i18n
shared/i18n/补齐中英词条,运行node scripts/i18n/generate-i18n.mjs并提交生成结果,没有手改生成文件;Viva 代码通过desktop/internal/i18n/的接口读取shared/i18n/(本 PR 不涉及插件文字)node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
性能与内存 / Performance and memory
a.background里完成gdi32.dll已有的系统调用读取设置 / Settings
N/A:没有新增或修改设置项。
插件契约 / Plugin contract
N/A:不涉及插件契约、能力版本、插件函数协议或宿主方法。Core#45 只改应用契约
processMemory.summarize。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh无用代码与重构 / Dead code and refactoring
ps/PowerShell 采样)验证 / Verification
LITHE_CORE_RUST_DIR=<Core#45 检出> scripts/desktop/desktop-go.sh test ./... -count=140711b1跑scripts/desktop/desktop-go.sh test ./... -count=1desktop-go.sh test ./internal/core/... ./internal/sysinfo/... ./internal/workbench/... ./internal/i18n/... -count=1go vet ./internal/sysinfo/(GOOS/GOARCH = windows/amd64、windows/arm64、linux/amd64,CGO_ENABLED=0)top -stats mem,cmprs,timedesktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualMemoryDetails$'node scripts/i18n/generate-i18n.mjs --check、node scripts/i18n/verify-app-language-localization.mjsverify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/preview HEADscripts/desktop/verify/verify-runtime-bundle-immutability.sh.agents/skills/write-stable-tests/scripts/verify-test-stability.sh与逐项计时cargo test -p lithe-process -p lithe-core、cargo fmt --check、cargo clippy -D warnings、verify-rust-core-comments.shrg(第三节)未能执行的检查和原因:
pending。提交前确认 / Final checks
preview创建并已 rebase 到最新的preview(ad9f995a3);目标分支preview.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图