Windows port, part 1: measurement probe (W0) and portability groundwork (W1) #29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "windows-port"
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?
Start of the Windows port: the measurement probe for a real Windows PC (phase W0) and the portability groundwork in the Linux code (phase W1). Linux behaviour and Linux file formats do not change.
W0:
ogc-probe.exe(tools/ogc-probe/, a crate of its own outside the Linux build)umgebung: Windows version, volumes and WOF availability, Steam libraries (registry,libraryfolders.vdf), Epic/GOG/Ubisoft/EA games, write-access checks without writing, Defender and Controlled Folder Access.bestand: how each game file is stored (WOF, LZNT1, reparse points, DirectStorage).schaetzen/messen: estimates for XPRESS4K/8K/16K and LZX and for btrfs zstd 1/3/6/9/15. It takes samples, calibrated by really WOF-compressing a sample in its own temp folder.selbsttest: works in a folder of its own and removes it.spiel/pruefen/zurueck), only after typing the game's key, with Steam closed:ogc-probe-bericht.json/.txt), in the curated measurement format of the database design. It contains no user, computer or domain names, no paths and no serials. It is checked before saving, shown, and saved only after confirmation. The console shows the profile folder as%USERPROFILE%.scripts/windows/measure-wof.ps1: acompact.exefallback with the same privacy rules. It decompresses exactly the files it compressed, also after an error or Ctrl+C.tools/ogc-probe/ANLEITUNG.txt.probe-1inLevelXStudios/ogc-messungenis built from this code.W1: portability groundwork
src/paths.rs: one place decides where files go. Linux keeps the exact XDG behaviour; Windows uses%LOCALAPPDATA%and%APPDATA%. It replaces seven copies of the layout.read_at, file locking andWriteStop:read_atand file locking (File::lock) are portable.WriteStopis classified byio::ErrorKind.src/platform/linux/(running,power,notify, re-exported under their old names), andcfggates for the migration, the helper, systemd, btrfs ioctls, polkit, udisks and the procfs detection.ogc liston Windows says so and exits 1 instead of "found nothing".tests/state_files.rs) writes and reads every state file and compares it to the old format.windows-check: clippy of the library,ogcand their tests forx86_64-pc-windows-gnullvm, with llvm-mingw, the toolchain and UCRT the Windows release will use.windows-wine-test: the portable unit tests under Wine, in a prefix of their own and without a display.scripts/windows/in-container.shruns the same jobs in a container. The host needs neither the target nor llvm-mingw nor Wine.Review
Checks
cargo fmt, both clippy runs, and all tests with and without the GUI (Broadway) are green on Linux.rollbackwith five boots.ogc25 passed.Not verified: every real WOF call. Wine has no WOF, so they ran against fakes. That is what the probe on the friend's PC is for.
Run 2 and 2b compressed "XPRESS4K/8K" as LZX and failed LZX and XPRESS16K with error 87. The cause: set_location passed the FSCTL's FILE_PROVIDER_EXTERNAL_INFO_V1 {Version 1, Algorithm, Flags} (12 bytes) to WofSetFileDataLocation, which takes WOF_FILE_COMPRESSION_INFO_V1 {Algorithm, Flags} (8 bytes). wofutil read Version 1 as the algorithm (LZX) and the algorithm as the flags; 1 and 3 set flag bit 0 (compress-on-write), which WOF refuses with 87. The read-back parser is right, so run 1's LZX labels and its x1.13 LZX correction stand. - numbers::api_info / fsctl_info build both buffers; a Windows test compares them with windows-sys' structs. - Every compress goes through wof::route::Router: API first, state read back, FSCTL where the API answers 87 or stores another algorithm. A wrong state is its own outcome (wrong_algorithm_<state>), never done; calls are counted per route and result. - wof-diagnose (menu 8, and in the self-test after the trial): the matrix of the diagnosis brief. Blocks A (seven buffers, both routes, T and license.rtf), B (three handles), C (eight at once), D (switch), E (compact.exe control), each copy read back by the parser and by WofIsExternalFile, undone and deleted, and a verdict with the decision rules. Tested against a model of Windows' behaviour. - Calibration: a factor only from a call that read back the algorithm asked for, only where the model saves at least 3 %, clamped to 0.8-1.4; a calibrated LZX estimate stays above 72 % of the raw model. - Throughput over compressed bytes only; H11/H12/H13 from real compressions; H6 is the median of the factors used. - One-game test: files by outcome code, routes, kept "original" and the record removed where nothing changed; every launcher of a shared folder must be closed. - WOF version shown as major.minor.build (10.0.10011). - A report of another version is never written over (-2, -alt). - Guide for run 3, ARCHITECTURE.md, Wine smoke test for wof-diagnose.