VM test: count a game compressed as ogc does, not by every extent #49

Manually merged
SkyfaR merged 1 commit from vm-flake into main 2026-10-07 08:55:50 +02:00
Owner

The redownload scenario failed now and then ("game 200 was not compressed" in #47's first run, "game 100" in a local reproduction). The failing file had one plain single-block extent out of 12288. btrfs never compresses a write-back range of one block, and write-back that starts while the fake Steam is still writing onto the compress=zstd mount can leave one behind. ogc counts a file that is at least 98 % compressed as done (ExtentStats::is_mostly_compressed) and rightly leaves it; the test wanted every extent encoded.

compressed() now counts blocks and accepts at most 2 % plain, ogc's own threshold; a file nobody compressed still fails (100 % plain), and the failure message shows the counts. The helpers move to tests/vm/common.sh so guest.sh stays under 500 lines. Not a product bug: two independent investigations found no case of ogc compressing a game Steam was still writing.

Verified: redownload 4× in a row, then redownload, space and convert after the move, all pass.

The redownload scenario failed now and then ("game 200 was not compressed" in #47's first run, "game 100" in a local reproduction). The failing file had one plain single-block extent out of 12288. btrfs never compresses a write-back range of one block, and write-back that starts while the fake Steam is still writing onto the compress=zstd mount can leave one behind. ogc counts a file that is at least 98 % compressed as done (`ExtentStats::is_mostly_compressed`) and rightly leaves it; the test wanted every extent encoded. `compressed()` now counts blocks and accepts at most 2 % plain, ogc's own threshold; a file nobody compressed still fails (100 % plain), and the failure message shows the counts. The helpers move to `tests/vm/common.sh` so `guest.sh` stays under 500 lines. Not a product bug: two independent investigations found no case of ogc compressing a game Steam was still writing. Verified: redownload 4× in a row, then redownload, space and convert after the move, all pass.
VM test: count a game compressed as ogc does, not by every extent
All checks were successful
CI / Windows, command line (clippy with tests) (pull_request) Successful in 34s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m18s
CI / Windows, MSYS2 sysroot (pull_request) Successful in 22s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 1m34s
CI / Format, lint and test (pull_request) Successful in 5m18s
CI / Arch package (pull_request) Successful in 2m36s
CI / Bundle programs, command line and helper (pull_request) Successful in 1m34s
CI / Windows, installer and portable zip (pull_request) Successful in 5m10s
CI / Bundle programs, desktop app (pull_request) Successful in 1m52s
CI / Windows, GTK with AccessKit (pull_request) Successful in 9s
CI / Bundle for any distribution (pull_request) Successful in 15s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m22s
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 1m27s
CI / Release (pull_request) Has been skipped
VM test / Migrations in a VM (pull_request) Successful in 18m20s
ea406dc713
The redownload scenario failed now and then with "game 100/200 was not
compressed". The failing file had one plain extent of a single block out of
12288; everything else was compressed. btrfs never compresses a write-back
range of one block, and write-back that starts while Steam still writes a file
onto the compress=zstd mount can leave such a range behind. ogc counts a file
that is at least 98% compressed as done (ExtentStats::is_mostly_compressed)
and rightly leaves it as it is, but guest.sh wanted every extent encoded.

compressed() now adds up blocks and accepts a file with at most 2% of them
plain, the threshold ogc uses. A file nobody compressed still fails (100%
plain), and the failure message shows the plain and all block counts.
SkyfaR manually merged commit f9ef5ae556 into main 2026-10-07 08:55:50 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LevelXStudios/OpenGameCompressor!49
No description provided.