Files
JIANT/web
Claude 378f2c5da6 MATH tab: formulas of one's own sent to the device (MATH USER, JIANT FM V10.8.75)
The MATH tab compiles a formula of one's own to the device's bytecode and sends it to a track, now that the firmware
plays them (JIANT FM V10.8.75, codex/v66-clean: firmware/src/math_user.c, JIANT BYTE's formula machine).

- FVM (in the MATH section): a port of JIANT BYTE's compiler (its firmware/src/fvm.c, GPL-3.0, the owner's): its
  grammar (t w a n v; C's operators; sin cos tri saw sqr abs min max floor int fix rnd sat clip; a string as a table),
  its INT / FIX types, its folding, its instructions, serialized as math_user.c reads them (EDITOR_PROTOCOL.md "1.5").
  ph() lp() hp() eu() and FUNC's calls are BYTE's only: refused with that message. At most 64 bytes, a stack of 12.
  FVM.run is math_user.c's machine in JavaScript; FVM.pack7 / unpack7 the backup's groups.
- The tab: a text that is one of the firmware's 48 BYTE formulas is sent as its ALGO, as before; any other is MATH
  USER (the message says its size and INT -> BYTE or FIX -> FLOAT). Heard through the emulator's own machine (the
  wasm's FORMULA, track 1 at ALGO USER), the model when the wasm is older. Sent with FORMULA (100) to a device whose
  INFO has 'E' (45 02 64 12), read back and compared, then the eight values with ALGO -4 (USER) and WAVE 5 (INT) or 6
  (FIX). Read: a track at ALGO USER gives its bytes; their text comes back if it was sent from this browser (kept in
  localStorage by its bytes). An older device: not sendable, as before. The generator's formulas are MATH USER ones.
- The mock device answers FORMULA and says 'E' and 'C' 1.5 (before its 'D' / 'H').
- EDITOR_PROTOCOL.md: the proposal becomes "1.5: MATH USER, a formula of one's own (100; V10.8.75)": the command, the
  bytes (BYTE's FO_* numbers, the operand modes), the checks, what is not in JIANT FM, the project block, the presets;
  the version table and the frozen command numbers.

Tests:
- math_test.mjs: web/math_fvm_gold.json (142 texts compiled by BYTE's own fvm_compile from BYTE origin/main 1495526,
  serialized, run by its fvm_run): FVM gives BYTE's bytes for all 135 that fit (93 of BYTE's 96 factory formulas: B16 and F32 are over 64 bytes, F05 and F22 use ph(); and every operator),
  FVM.run BYTE's values for each (3 x 4160); the 7 refused refused; errors with their place; pack7; the generator's
  formulas fit. With EMU_WASM: B01's bytecode at ALGO USER plays B01's samples bit for bit; FORMULA reads back; a FIX
  formula on FLOAT sounds. Passes against a wasm built from the firmware's V10.8.75 commit (emsdk 6.0.11).
- editor_browser_test.mjs: on the firmware wasm, a formula of one's own compiled, sent to track 4 (FORMULA 4 0 gives
  the editor's bytes, ALGO -4), read back into the editor with its text; without a device, one's own heard through the
  emulator (the model without one), a FIX floatbeat recognised. Passes (with that wasm); test_web, test_backup,
  test_manual pass.

The public emulator (web/EMULATOR's pin) gets the VM when the pin moves to the firmware's V10.8.75 commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-11-30 11:13:55 +00:00
..
2026-10-05 23:16:53 +09:00
2026-10-05 23:16:53 +09:00
2026-10-03 16:06:39 +09:00