Skip to content

Distribute C solvers as a versioned WebAssembly package - #32

Draft
xtraid wants to merge 9 commits into
mainfrom
feat/browser-solver-package
Draft

xtraid wants to merge 9 commits into
mainfrom
feat/browser-solver-package

Conversation

@xtraid

@xtraid xtraid commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Wang Studio consumes Foundry's C solvers as an independent, versioned WebAssembly package on static hosting. The public JavaScript API supports square, triangular and hexagonal regions, resumable enumeration, cancellation and provenance; native APIs and canonical tiles remain unchanged.

Browser domains use arrays of 32-bit words instead of a single tile mask. Color arrays use 32-bit indices when needed, and propagation uses runtime-sized color support tables. Inputs above 32 tiles, 16 colors or 4096 cells use the private dynamic browser engine for both solver selections. Smaller inputs retain the existing native reference/optimized paths. Duplicate edge tuples remain collapsed and witnesses are checked in C and independently in JavaScript.

Release 0.3.0 uses private Wasm ABI 3. The build requires a clean checkout and Emscripten 4.0.23; normalized tar/gzip metadata makes the archive reproducible. The manifest records source revision, compiler, flags and artifact hashes. Studio remains in its own repository: https://github.com/xtraid/wang-studio.

Validation:

  • make -j4 check: passed native C, all 252 Python tests, serial/shared/OpenMP builds, benchmark comparisons and documentation checks (41 public routes).
  • Actual Wasm: independent exhaustive comparisons on 600 randomized instances; five geometries; 23/31/32/33/64/65/96/97/257/1025 tiles; high-ID pins, duplicates, pause/resume, holes and disconnected regions.
  • Wide colors: 17/33/256/257/1025 colors across all geometries, adjacent SAT/UNSAT, symbolic equal-RGB colors, palette index 65535 and sparse/large regions.
  • ASan/UBSan including leaks: passed odd/even cycles, rollback, invalid tail bits, wide-color sentinels and every reached allocation failure.
  • Wasm allocation exhaustion returns an error rather than exhaustive UNSAT and permits subsequent allocations.

Operational limits remain 65536 active cells, 65536 palette/used colors and a 2 GiB Wasm linear-memory ceiling (allocation may fail earlier). The active timeout defaults to 600 seconds; zero disables it. Larger-domain performance does not claim native optimized performance. Browser deadlines can be delayed by background-tab throttling.

Release: https://github.com/xtraid/tiling-foundry/releases/tag/solver-web-v0.3.0. Two local clean rebuilds and the independently built GitHub release archive are byte-identical (SHA-256 10043becfd404944575808b092400085d12767f3159d0a3f77b9ec88898d8ad6). Source commit: cb56814760f78ee59e76e41ebfb61e3287237372.

This branch has not been deployed

No deployments
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