Commit Graph
6 Commits
Author SHA1 Message Date
osobhandClaude Opus 5 a97663e631 Bump pyo3 0.24 -> 0.29 so symclaw-python builds on Python 3.14
The bindings could not build against the installed interpreter, so the
whole workspace had to be checked with --exclude symclaw-python. Two API
changes: PyObject left the prelude (now Py<PyAny>), and #[pyclass] types
implementing Clone must opt in to the FromPyObject derive.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-19 20:01:26 -07:00
osobh a44207c782 Merge branch 'feat/symclaw-gpu-cubecl-0.10-cuda' 2026-06-24 10:56:10 -07:00
osobhandClaude Opus 4.8 2c43fc3399 fix(symclaw-gpu): cubecl 0.10 migration + CUDA backend + bounds-guard fixes
Migrates symclaw-gpu from cubecl 0.9 to 0.10 (0.9's cuda backend was upstream-
broken) and fixes the long-standing cpu/cuda-backend failures so all three
backends are green.

cubecl 0.10 API migration (eval/ntt/linalg/groebner/poly_gcd/monte_carlo):
- ArrayArg::from_raw_parts(handle, len) — handle by value, no generic/vectorize.
- read_one -> read_one_unchecked (returns Bytes, matching 0.9 behavior).
- scalar launch args passed as plain values (ScalarArg::new removed).
- launch returns () now: drop .is_ok()/.expect()/`let _ =` on launch results.

Correctness fix (the real bug behind the SIGSEGV + 3 failing NTT tests):
- NTT kernels (butterfly, pointwise_mul, scale) lacked bounds guards. The launch
  rounds thread count up to the cube dim, so most threads were padding doing
  OUT-OF-BOUNDS reads/writes. wgpu/Vulkan tolerated it; the cuda/cpp backends
  corrupted the buffer (garbage NTT results) or SIGSEGV'd. Added `if tid < len`
  guards. Also inlined gpu_mod_mul's <<16 reductions (no nested cube-fn calls).

Validated on `tank` (RTX 5060 Ti): wgpu 101/0, CUDA 101/0, cpu 118/0 — clippy
clean on all three. The GPU Monte-Carlo interpreter matches analytic integrals
on both CUDA and wgpu. The prior cpu SIGSEGV and 3 NTT failures are resolved.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-24 10:56:10 -07:00
osobh c199c142a4 Merge branch 'feat/real-gpu-monte-carlo' 2026-06-24 08:20:28 -07:00
osobhandClaude Opus 4.8 0f99d7de80 feat(symclaw-gpu): real GPU + CPU Monte-Carlo integration (no stub)
The previous gpu_monte_carlo_integrate ignored the device (`let _ = device`)
and ran a CPU loop — a stub. Replace it with a genuine GPU implementation:

- mc_eval_kernel: a per-thread CubeCL bytecode INTERPRETER. Each thread samples
  the variables (hashed RNG), then walks the uploaded stack-machine program
  (encoded ops + f32 const pool) with a private stack, supporting all opcodes
  (load var/const, +−×÷, pow via exp·ln, neg, sin/cos/tan, exp, ln, sqrt, abs).
  Host reduces the per-sample values → integral.
- cpu_monte_carlo_integrate_nd: the real CPU path (kept, not a stub), used on
  the CPU backend or when the program/var count exceeds the kernel's comptime
  stack/var limits.
- gpu_monte_carlo_integrate[_nd] now dispatch: GPU kernel on GPU backends
  (CUDA/wgpu), CPU loop otherwise. Both are full implementations.

Verified on `tank` (wgpu/Vulkan, SYMCLAW_GPU_TEST=1): the kernel computes
∫₀¹x² dx ≈ 1/3 and ∫₀^π sin x dx ≈ 2 at 1e6 samples. Full default (wgpu) suite
101/101 green; monte_carlo cpu tests 4/4.

Notes: symclaw-gpu is on cubecl 0.9, whose `cuda` backend is upstream-broken;
running symclaw's GPU MC on CUDA needs a cubecl 0.9→0.10 migration of all
symclaw-gpu modules (separate effort) — wgpu already runs on the NVIDIA GPU.
Pre-existing cubecl-cpu software-runtime failures in ntt/eval/poly_gcd are
unrelated to this change.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-24 08:20:28 -07:00
redclawsystems f4b75db2ee Merge pull request 'test(symclaw-skill): cover handlers_advanced via JSON API' (#10) from ci-doctor/coverage-20260518-201834 into master
Reviewed-on: #10
pre-rewrite-2026-06-05
2026-05-19 04:39:49 +00:00