Skip to content

feat(rendering): add Cairo parity baseline and GUI metrics - #136

Merged
Zaldaryon merged 1 commit into
mainfrom
feat/issue-130-gui-parity
Oct 8, 2026
Merged

Zaldaryon merged 1 commit into
mainfrom
feat/issue-130-gui-parity

Conversation

@Zaldaryon

Copy link
Copy Markdown
Collaborator

Summary

This implements Stage 1 of #130 as an evidence and profiling baseline. It adds a Linux Cairo versus Skia CPU parity harness, GUI primitive and override manifests, an exported Cairo API inventory, a compile-once/run-against-candidate ABI fixture, and opt-in metrics for GUI composition, text measurements, and Cairo texture uploads.

Every unvalidated operation remains on native Cairo. This PR does not add a GPU renderer or claim cross-backend pixel parity or performance gains.

Validation

  • make check
  • make build (0 warnings, 0 errors)
  • make check-patches (70 source patches, 52 Cecil patches, 0 pending or conflicts; 22 runtime donors compiled)
  • make check-shaders
  • All five test projects: 1,059 passed, 34 skipped, 0 failed
  • Cairo parity harness: repeated Cairo renders were byte-identical at scales 1.0, 1.5, and 2.0; Cairo versus Skia differences remain diagnostic
  • scripts/test-cairo-abi.sh against the installed Vintage Story 1.22.7 Cairo assembly passed
  • Vintage Story 1.22.7 Linux client launched, loaded shaders including the GUI shader, and reached the login screen. The cached session key was invalid, so this run did not enter a world.

The GUI manifest inventories 57 composition overrides, but they remain not-rendered until each fixture has runtime evidence. The API classification also needs human review before any replacement backend can claim full ABI compatibility. Full GUI coverage and GPU validation remain future work.

@Zaldaryon
Zaldaryon merged commit 72892d5 into main Oct 8, 2026
Zaldaryon added a commit that referenced this pull request Oct 16, 2026
The Optimum CLI patches VintagestoryAPI.dll from the pristine copy in <game>/.optimum/vanilla. ApiPatcher built its Cecil resolver from the input directory, its Lib folder and the contracts directory, so the game's own Lib folder was never searched. PatchGuiCompositionMetrics (added in #136) resolves a type from cairo-sharp.dll, and Cecil threw AssemblyResolutionException. The patcher exited with code 134 and the CLI reported patch-conflict.

ApiPatcher.CreateResolver now also searches the game root and its Lib folder when the input sits under a .optimum directory. They come last, so the backup's VintagestoryAPI.dll still wins over the game root's already patched copy. The launcher flow, which passes the game root's DLL, already found Lib and keeps working.

Reproduced end to end on the official 1.22.7 client with a neutral contracts directory: before the change, dotnet Optimum.Patcher.dll --api exits 134 with the resolution error from PatchGuiCompositionMetrics. After it, the command exits 0 and writes the DLL. Two new tests cover the backup layout (failed before the change) and the game-root layout.

Refs #140
Zaldaryon added a commit that referenced this pull request Oct 16, 2026
The Optimum CLI patches VintagestoryAPI.dll from the pristine copy in <game>/.optimum/vanilla. ApiPatcher built its Cecil resolver from the input directory, its Lib folder and the contracts directory, so the game's own Lib folder was never searched. PatchGuiCompositionMetrics (added in #136) resolves a type from cairo-sharp.dll, and Cecil threw AssemblyResolutionException. The patcher exited with code 134 and the CLI reported patch-conflict.

ApiPatcher.CreateResolver now also searches the game root and its Lib folder when the input sits under a .optimum directory. They come last, so the backup's VintagestoryAPI.dll still wins over the game root's already patched copy. The launcher flow, which passes the game root's DLL, already found Lib and keeps working.

Reproduced end to end on the official 1.22.7 client with a neutral contracts directory: before the change, dotnet Optimum.Patcher.dll --api exits 134 with the resolution error from PatchGuiCompositionMetrics. After it, the command exits 0 and writes the DLL. Two new tests cover the backup layout (failed before the change) and the game-root layout.

Refs #140
@Zaldaryon
Zaldaryon deleted the feat/issue-130-gui-parity branch October 22, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant