Windows port, part 2: WOF engine, Windows platform and commands (W2) #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "windows-w2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Windows port, phase W2. It builds on #29 (W0 probe, W1 groundwork) and adds the engine, the platform layer and the commands. Plan: windows-port-plan.md, section 10, W2 row.
Engine (
src/backend/,src/compress/wof_*,src/estimate/wof*,src/skipcache.rs)wof:xpress8k.--force. So CompactGUI's LZX files do not grow as XPRESS8K. A decision not to switch is remembered.CompressSummarygainsexact,guessed_filesandguessed_bytes.Platform (
src/platform/windows/,src/launchers/,src/pause.rs)SteamPathnormalised,libraryfolders.vdf, manifests. Theinstalldircheck is stricter on both systems, as the plan says.RunningAppIDonly chooses which folder is searched first, and never pauses on its own.GetSystemPowerStatus.check.shallows only reviewed DLLs inogc.exe, so user32 cannot slip in.platform::replace).Commands (
src/commands/windows/,src/commands/wof*)ogc analyze,compress,decompressandautorun on Windows.dedupe,migrateandtimerare hidden there.Packaging (
scripts/windows/dist.sh)opengamecompressor-<version>-windows-x86_64.zip. libunwind is linked in, so it needs no extra DLL; an import allow-list enforces this.ogc-wintest-<version>.zip: real-WOF tests,run-tests.ps1and a German guide. Checked under Wine and PowerShell 7.wintest-1in the measurement repo, built from04ffeb4.Tests
OGC_TEST_REQUIRE_BTRFS=1 cargo test, and the Broadway suite.check.sh, andwine-test.shwith lib 336 and bin 72 passing plus the smoke run.Not verified yet
OGC_TEST_REQUIRE_NTFSend-to-end test, the room rules, and WOF's disk-full behaviour mid-file.RunningAppID(H18), and logoff/shutdown delivery.The friend's PC run with
wintest-1covers the first part of these. Its report decides what follows before merging.The engines now sit behind src/backend/: Backend::{Btrfs, Wof} names what each writes (zstd 3 and XPRESS8K by default), its chunk size, whether it needs a sync, and why a folder cannot be compressed (Backend::for_path, Refusal). btrfs.rs moved to backend/btrfs.rs and compress.rs's per-file step to compress/btrfs_file.rs, both unchanged; compress.rs keeps what every engine reports and the parallel walk. pause::Pause, decompress's and analyze's reports are shared files now. The WOF engine is built and tested on every system through a Layer, which backend/wof/sys/ implements with Windows' calls and backend/wof/fake.rs with a stand-in: - backend/wof.rs holds Microsoft's numbers alone: the algorithm numbers, the 8-byte WOF_FILE_COMPRESSION_INFO_V1 for WofSetFileDataLocation (the FSCTL's 20 bytes where wofutil.dll is missing), the read-back of FSCTL_GET_EXTERNAL_BACKING (provider at byte 4, algorithm at byte 12), the Win32 codes, and the skip rules. - Volume admission: local NTFS with an answering WOF driver only; ReFS, FAT, exFAT, network drives, Windows' and the Xbox app's folders, drive and profile roots and OneDrive are refused with a reason. An effective-access check tells folders that need administrator rights. - Per file (compress/wof_file.rs): too small, cloud and offline files are left alone without being opened; files are opened for reading, shared with readers only, so an open writer means in use; reparse points, encrypted, WIM-backed, LZNT1, sparse, hard-linked and read-only files are left alone; the skip cache and a 16-chunk sample decide incompressible files; room is kept as plan R5 says; every call is read back and only the algorithm asked for counts; error 344 is "not beneficial" and remembered. Sizes after a run are exact. - The skip cache (skipcache.rs) is SQLite in the cache folder, keyed by volume serial, file ID, size, LastWriteTime and algorithm. - Analysis (compress/wof_analyze.rs) reads each file's samples once for all four algorithms with Windows' XPRESS Huffman encoder; LZX is that model at 32 KiB with run 1's correction (saving x1.13, at least 72 % of the model). - Decompress (compress/wof_undo.rs) deletes the external backing of each WOF file and reads it back. On Windows, compress, decompress and analyze offer this engine with the API of Linux' modules; fs_info reads the volume. The codec is threaded through state::Entry, auto's TimerConfig, Status and tasks, and history::Detail; games.tsv, prefixes.tsv, analysis.tsv, the history and the timer's unit still write a zstd level bare, Windows writes wof:xpress8k, and a line of a codec the system's engine does not write is left out. --level takes either form and --algorithm a WOF algorithm (hidden on Linux); ogc list names a WOF game's algorithm. Messages in all 13 languages.