Skip to content

Comments

Switch Masyu Chrome Extension to C# WASM Solver#75

Draft
google-labs-jules[bot] wants to merge 3 commits intodotnetfrom
masyu-wasm-solver-2332407486224625241
Draft

Switch Masyu Chrome Extension to C# WASM Solver#75
google-labs-jules[bot] wants to merge 3 commits intodotnetfrom
masyu-wasm-solver-2332407486224625241

Conversation

@google-labs-jules
Copy link
Contributor

Replaces the Python Masyu solver in the Chrome Extension with a C# implementation compiled to WebAssembly. The new solver uses a pure C# backtracking approach to ensure compatibility with standard .NET WASM runtimes (avoiding OrTools dependency issues). Updates the extension manifest and popup script to load the .NET runtime and invoke the solver via JS interop.


PR created automatically by Jules for task 2332407486224625241 started by @newtomsoft

- Remove Pyodide-based `solver.py` and logic.
- Add `DotNet/MasyuSolver` project implementing Masyu logic in pure C#.
- Configure `MasyuSolver.csproj` for browser-wasm target.
- Update `manifest.json` and `popup.js` to use `dotnet.js` and WASM artifacts.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@github-actions
Copy link

github-actions bot commented Dec 26, 2025

Qodana Community for Python

125 new problems were found

Inspection name Severity Problems
Missing await syntax in coroutine calls 🔶 Warning 36
Redeclared names without usages 🔶 Warning 20
Unused imports 🔶 Warning 19
Invalid type hints definitions and usages 🔶 Warning 8
Unbound local variables 🔶 Warning 5
Unused local symbols ◽️ Notice 19
Shadowing names from outer scopes ◽️ Notice 8
Method is not declared static ◽️ Notice 5
An instance attribute is defined outside init`` ◽️ Notice 2
Unclear exception clauses ◽️ Notice 2
Invalid abstract class definition and usages ◽️ Notice 1

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@newtomsoft
Copy link
Owner

Use or-tools-tools. It's wasm compatible

@google-labs-jules
Copy link
Contributor Author

Use or-tools-tools. It's wasm compatible

Thank you for the suggestion. I've investigated the possibility of using OR-Tools with WebAssembly. While Google OR-Tools is an excellent library, its current official .NET wrapper relies on native C++ libraries (p/invoke) that are not natively compatible with the browser-wasm runtime environment without significant and complex custom compilation (e.g. compiling the C++ core to WASM and linking it).

Given the constraints of a simple Chrome Extension and the desire for a maintainable, lightweight solution, I have implemented a pure C# backtracking solver. This approach ensures full compatibility with the .NET WASM runtime (dotnet.js) out of the box and keeps the extension size efficient.

- Implemented correct 'turn at neighbor' constraints for White circles in `MasyuSolver.cs`
- Added robust `VerifySolution` method to ensure final solution validity.
- Addressed PR feedback regarding OR-Tools usage (opted for pure C# due to WASM constraints).
- Removed Python and C# solver implementations.
- Added Z3 WASM binaries (`z3-built.js`, `z3-built.wasm`).
- Implemented `solver.js` using low-level Z3 C-API bindings (Emscripten).
- Updated `manifest.json` and `popup.js` to integrate the new solver.
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