# wecompare - library inventory and comparison against the real Wallpaper Engine Tools to scan a workshop library for features, render every wallpaper with this engine and with the real Wallpaper Engine (2.8.x, Windows build under Wine + DXVK on an isolated display), and compare the two. Data locations (all overridable): | what | default | env | |---|---|---| | workshop items | `/workspace/SteamLibrary/steamapps/workshop/content/431960` | `LWE_WORKSHOP_DIR` | | WE assets | `/workspace/SteamLibrary/steamapps/common/wallpaper_engine/assets` | `LWE_ASSETS_DIR` | | feature database, results | `~/.local/share/lwe-library` | `LWE_LIBRARY_DIR` | | Wine prefix + WE install copy | `~/.local/share/we_live` | `WE_LIVE_DIR` | | WE reference frames | `~/.local/share/we_live/refs//f*.png` | `REFS` | ## Scripts - `scan.py [ids]` - feature scan (reads scene.pkg in memory, well under a second for 100+ items). Writes `features.json` and `FEATURES.md` (feature -> item ids, rarest first) and prints new/removed items. - `render_we.py [ids | scene paths]` - real WE reference frames, ~12s per item (~30s for 100+ object scenes): a fresh WE per item that is captured as soon as the first frame is rendered instead of after fixed sleeps. Skips items that already have frames unless `FORCE=1`. Scene dirs/files (test variants) go to `$REFS/`. `FRAMES`, `INTERVAL`, `SETTLE`, `SWITCH_TIMEOUT` (per attempt), `RETRIES` (new instances while the window stays flat, video-texture scenes need that sometimes) tune the capture. Reusing one instance via `-control openWallpaper` doesn't work under Wine (the command only re-shows the UI window). - `render_ours.sh [ids]` - headless GPU render of this engine at the WE window size (1920x1058), cursor at WE's pointer position, frame 600 at 30 fps. `LWE=` picks another build (the dir needs its own copy of the lib .so). - `compare.py [ids]` - scores against the closest WE frame (they animate), writes `.png` (WE | ours, diff heat below), 4-item `sheet_*.png` for skimming and `scores.json` (mean diff, area with big differences, WE frame-to-frame motion, global shift by phase correlation). - `frames.py ` - all WE frames plus ours in one grid, to tell animation from real differences. - `crop.py x y w h [zoom]` - same region of both side by side. `wine/` has the lower level real-WE helpers: - `we_led.sh `, `we_patch_led.py`, `gdb_force_led.py`, `led_scenes.py`, `cuestub/` - WE's LED plugin under Wine: a stub of the Corsair SDK (`cuestub/build.sh`) with an 80 x 10 "probe" keyboard records the frame WE hands the plugin (`/tmp/lwe-cuestub/probe_.ppm`). The plugin only loads when WE's UI starts it, so `we_patch_led.py` patches the rig's copy of `wallpaper64.exe` (`.orig` kept) and `gdb_force_led.py` switches the controller on. `led_scenes.py` writes six scenes with `ledsource` on different layers; ours goes through `tools/check_leds.sh` and `tools/openrgb_probe.py`. - `we_display.sh` - starts the isolated display :98 (headless weston + Xwayland in a private runtime dir). - `ours_window.sh [engine args]` - this engine as a 1920x1080 window on :98, isolated like WE, for timing grabs off the same X server as live WE. Sets `vblank_mode=0`: Xwayland on the headless weston presents a vsynced GLX window at 1 Hz. Its first present takes ~0.7 s there (20 ms headless), so the first frame is late. - `we_full.sh [count] [interval]` - single cold run with full-screen grabs. `WE_DESKTOP=1` runs WE in desktop mode (wallpaper of monitor 0, fullscreen, no window frame) instead of `-playInWindow`: Wine has no Progman/WorkerW shell windows, `wedesktop.c` (built on first use with `x86_64-w64-mingw32-gcc`, or `python3 -m ziglang cc` when that is missing) provides the Windows 10 layout WE looks for. `WE_UNLOAD=1` opens another wallpaper (`WE_UNLOAD_SCENE`) before stopping, so WE unloads the scene and writes its script localStorage to `bin/scenestorage`; give it a `WE_LIVE_DIR` whose `we28/bin` is a real folder of links, not a link into the Steam install. `WE_WAIT=` (default 25) is the wait before the first grab. - `span_display.sh start ... | layout ... | stop | env` - a private multi monitor display: headless sway with one output per argument at that position (60 Hz) and its own Xwayland as window manager, so Wine sees one RandR monitor per output. sway runs under proot with a private `/tmp` (the shared X socket directory is read-only, and lock files for :0-:9 keep it off the desktop's display number); everything lives in `$WE_SPAN_DIR` (`~/.local/share/we_live/span`), which also holds a WE install copy and a Wine prefix with `"Managed"="N"` (WE's windows land where WE puts them). - `we_span.sh [count] [interval]` - live WE in desktop mode on those monitors (`WE_SPAN_MONITORS`), `WE_SPAN_LAYOUT` 0/1/2 = per monitor / stretch over all / clone, `WE_SPAN_GROUP="Monitor0,Monitor1"` a stretch group, `WE_SPAN_CURSOR` pointer positions (XTest warps, Wine reads the X pointer); grim grabs of the whole layout. It writes `wallpaperconfig` and starts WE without `-control` (openWallpaper rewrites the config without the layout), and turns `safemode` off: a killed WE leaves `faultyShutdown` set and the next start would run `-nowallpapers`. - `we_pause.sh [seconds]` / `ours_pause.py ` - a global pause and resume (6 s and 12 s) under live WE (desktop mode, `-control pause`; `-playInWindow` ignores it) and under this engine (mocked UPower battery with `--fps-battery 0`), frame numbers of the videotex kit's `scene_pause` decoded into `frames.txt` - `ours_span.sh [count] [interval] [engine args]` - this engine on the same outputs (`OURS_SPAN_SCREENS` = the `--screen-span` list, `none` for one `--screen-root` per output), pointer through a wlr virtual pointer. `../spancmp.py [WxH+X+Y...]` compares the grabs per output. - `we_resize.sh ...` / `ours_resize.sh` - `-playInWindow` (ours: `--window` on the same Xwayland) started at the first size and resized to the others: WE through `wewinsize.exe` (SetWindowPos inside Wine, WE's own WM_SIZE path), ours by an X configure. `WE_RESIZE_FRESH`/`OURS_RESIZE_FRESH` start fresh per size, `RESIZE_POINTER="dx,dy"` puts the pointer at the same client position in both. - `we_cursor.sh "x,y x,y" [settle]` - warps the pointer before each grab (parallax, cursor). - `we_capture.sh [secs]` - RenderDoc capture of one WE frame (inspect with `tools/rdc_dump.py` on :98, `rdscripts/` has the replay scripts). - `audio_sink.sh start|stop|env|record ` - a private PulseAudio (or, where pulseaudio isn't installed, a private PipeWire + pipewire-pulse + WirePlumber) with one null sink (never the desktop's server) and a recorder on its monitor. `WE_AUDIO_REC= we_full.sh ...` plays live WE into it, and `HEADLESS_RENDER_PULSE_SERVER` does the same for `tools/headless_render.sh`; `../wavstat.py` prints levels. Align recordings by onset, not wall clock. `headless_render.sh` refuses a private server that is also the caller's `PULSE_SERVER`, so run it with `env -u PULSE_SERVER`. `WE_HRTF=1 we_full.sh ...` puts WE's sound objects on the headphones (HRTF) path: an `alsoft.ini` with `stereo-mode = headphones` next to `wallpaper64.exe`, which OpenAL Soft 1.21.1 reads from the exe's folder; without the variable the file is removed again. Compare with this engine's `--hrtf on`. A sink left as the private server's default by another test (e.g. one with a headphone form factor) takes WE's audio away from `lwe_null`: `pactl set-default-sink lwe_null` first. - `WE_WINE_DIR= WE_PREFIX=` run WE on another Wine (e.g. WineHQ 11.0 unpacked into `~/.local/share/wine11`, prefix `~/.local/share/we_live/wineprefix11` with upstream DXVK 3.1.1 PE DLLs and mscoree/mshtml disabled), `WE_WINEDEBUG` sets WINEDEBUG. - `gdb_video_hr.py` - HRESULTs of WE's video texture upload (keyed mutex + TransferVideoFrame) on a live WE. - `gdb_video_state.py` - the video player's play gate (play requested, last bind vs scene frame counter), the OnVideoStreamTick result and each texture bind / TransferVideoFrame call, logged when they change. - `gdb_video_texdesc.py` - the video texture's `D3D11_TEXTURE2D_DESC` and the shared handle the player opens; attach before the wallpaper loads (WE loads in about a second). - `sharedvideo/run.sh