Fix language runtime size measurement correctness (Issue #55)#56
Fix language runtime size measurement correctness (Issue #55)#56
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #55
Root causes identified and fixed: 1. Integer division truncation: `diff_bytes / 1024 / 1024` truncated any component under 1 MiB to 0 MB. Fixed to use rounded MB division: `(diff_bytes + 500000) / 1000000`. Affected: Essential Tools (741 KB → 1 MB), GitHub CLI (549 KB → 1 MB), and improved accuracy across all components. 2. Unreliable df-delta for Rust and Homebrew: Both tools use mv/hardlink operations during installation that don't change df block counts. Fixed by switching to du-based measurement of installed directories (~/.rustup, ~/.cargo, /home/linuxbrew/.linuxbrew) after installation completes. 3. Missing component: Added 'bubblewrap' measurement (installed in full-sandbox but not previously measured). 4. Updated data/disk-space-measurements.json with corrected size_mb values using the new rounding formula applied to existing size_bytes data. 5. Updated README component sizes table with corrected values. Adds docs/case-studies/issue-55/CASE-STUDY.md with full timeline, root cause analysis, evidence, and proposed solutions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 24be865.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
|
|
🤖 AI Work Session Started Starting automated work session at 2026-02-23T08:47:21.687Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
Replace integer rounding `(diff_bytes + 500000) / 1000000` with awk-based
floating-point division `awk "BEGIN {printf \"%.2f\", bytes / 1000000}"` to
produce precise decimal values instead of rounded integers.
- Essential Tools: 741376 bytes -> 0.74 MB (was 1 MB)
- GitHub CLI: 548864 bytes -> 0.55 MB (was 1 MB)
- .NET SDK: 504905728 bytes -> 504.91 MB (was 505 MB)
Also update add_measurement() to store size_mb as float in JSON (not int),
update finalize_json_output() to store total_size_mb as float, and
regenerate data/disk-space-measurements.json and README.md table with
precise decimal values.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🔄 Auto-restart 1/3 LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
Fixes #55 — checks correctness of language runtime size measurements and fixes multiple root causes of incorrect/zero values.
Root Causes Found & Fixed
1. Integer Division Truncation → Replaced with Float Precision (Primary Fix)
Before:
diff_bytes / 1024 / 1024— floor division truncated any component under 1 MiB to 0 MBAfter:
awk "BEGIN {printf \"%.2f\", $diff_bytes / 1000000}"— precise decimal valuesAffected components: Essential Tools (741 KB shows as 0.74 MB), GitHub CLI (549 KB shows as 0.55 MB), and improved accuracy across all components (e.g. 504905728 bytes shows as 504.91 MB instead of 505).
2. Unreliable
dfDelta for Rust and HomebrewBoth
rustupand Homebrew usemv/hardlink operations internally that don't change filesystem block counts during installation, causing near-zerodfdeltas (~96 KB for Rust, ~16 KB for Homebrew) despite actual sizes of 700+ MB and 200+ MB respectively.Fix: Switched to
du -sbmeasurement of the actual installed directories after installation (instead of df delta).3. Missing Component
bubblewrapis installed inubuntu/24.04/full-sandbox/install.shbut was not measured. Added measurement.4. Data & README Updated
data/disk-space-measurements.jsonupdated with correctedsize_mbfloat values (e.g.0.74instead of1)README.mdcomponent sizes table updated with precise float valuesCase Study
Full root cause analysis documented in
docs/case-studies/issue-55/CASE-STUDY.mdwith timeline, evidence, and proposed solutions.Changes
scripts/measure-disk-space.sh— Useawk-based float division forsize_mb, updateadd_measurementto store float, addbubblewrap, usedu-based measurement for Rust and Homebrewdata/disk-space-measurements.json— Correctedsize_mbfloat valuesREADME.md— Updated component sizes table with precise decimal valuesdocs/case-studies/issue-55/CASE-STUDY.md— New case study🤖 Generated with Claude Code