01539e7e

By: lcnbr <im@lcnbr.ch>

fix portable Spenso Typst display

Restore structured manual-math leaves in the native Typst tensor printer,
route built-in metrics through the same attachment layout, make declaration
equality semantic rather than provenance-dependent, and preserve precise
collision diagnostics. Rebuild the committed Tydenso bundle with the fixes.

User prompt:

PLEASE IMPLEMENT THIS PLAN:
# Split Tymbolica and Tydenso into Their Owning Repositories

## Summary

- Keep Tymbolica, Rubi, and the shared `tymbolica-atom-payload` crate in `lcnbr/tymbolica`.
- Move all Tydenso Rust code, Typst files, documentation, examples, Wasm build tooling, and compressed artifacts into GammaLoop.
- Make the dependency strictly one-way: GammaLoop depends on `tymbolica-atom-payload`; Tymbolica has no Spenso, Idenso, or GammaLoop dependency.
- Continue GammaLoop work in the existing JJ workspace on top of `simplify-spenso-api`.

## Repository and dependency changes

- Merge `tymbolica-typst-ast` into `tymbolica_atom_payload::typst_ast`, leaving one shared Git dependency.
- In both repositories, declare `symbolica = { version = "2.2", default-features = false }` and patch `symbolica`, `numerica`, and `graphica` to the same exact official `dev` revision. Resolve current `dev` once and pin that SHA in every root patch; currently this is `ec19eeb211685aa216dbd28a4df547cd4c6baca1`.
- Remove Tymbolica’s `vendor/symbolica-wasm` adapter and the `lcnbr/symbolica` pin. Official `dev` now contains the generalized partial-import remapping fix.
- Tymbolica’s plugins select `symbolica/wasm`; ensure `symbolica-integrate` disables Symbolica default features so Rubi cannot pull GMP or native code generation into Wasm.
- GammaLoop references the pushed Tymbolica commit exactly:

  ```toml
  tymbolica-atom-payload = {
    git = "https://github.com/lcnbr/tymbolica",
    rev = "<exact-tymbolica-commit>",
    default-features = false,
  }
  ```

- Give the payload and reusable GammaLoop crates explicit `native` and `wasm` feature forwarding. Native selects `integer-gmp` and `float-mpfr`; Wasm selects `symbolica/wasm`. Keep native code generation separate and native-only.
- Regenerate GammaLoop’s Hakari workspace-hack data for Symbolica’s renamed features.
- Give Tydenso a nested Cargo workspace under `tydenso/`, with its own lockfile and identical Symbolica patches. This prevents native workspace builds from unifying GMP/native-code-generation features into the Wasm graph.

## Shared Atom contract

- Keep `tymbolica-atom-payload` Symbolica-dependent. It owns native Atom export/import, attachments, generic render trees, and Parsely-CBOR-to-Atom conversion.
- Replace the envelope in place without legacy public `V1`/`V2` APIs or compatibility readers:
  - retain magic, internal envelope version, native Atom bytes, and schema-keyed attachments;
  - remove the embedded Git SHA, `build.rs`, `SYMBOLICA_REVISION`, and revision-mismatch errors;
  - preflight the native Atom header before exposing attachments or mutating Spenso state, accepting the pinned writer format only: Symbolica magic `0x37871367` and export format `5`.
- Symbolica’s native export remains responsible for names, namespaces, tags, user data, and exact Atom structure.
- Portable attachments carry Spenso representation and manual math-display declarations. Typst head/call customization remains external notation, never symbol content.
- Move the `spenso.representation` and `spenso.math-display` codecs and registration logic into an optional Spenso portable-payload module, shared by Tydenso and Spynso.

## Tydenso and Spynso

- Move the Tydenso plugin, its local inflater/compressor, complete `tydenso/` Typst package, manual, tests, examples, and committed Wasm bundles into GammaLoop.
- Preserve `wasm-opt`, zlib compression, reproducible manual generation, and the hard compressed-size limit below 10 MiB.
- Update repository links and replace sibling-relative Tymbolica imports with local-package imports resolved against the exact pinned Tymbolica commit in CI.
- Bundle Tydenso’s `render.typ` and `notation.typ` directly into Spynso with `include_str!`; Python rendering must not invoke the Tydenso Wasm plugin.
- Add `DisplaySettings` with the existing ports layout plus Schoonschip and call layouts, dimension display, parentheses, commas, symbol scripts, and spacing controls.
- Extend existing display methods compatibly:
  - preserve positional calls such as `to_typst(True)` and `formatted(True)`;
  - add `to_html`, `to_svg`, semantic `_repr_html_`, and trusted `notation_source` overrides;
  - keep `TensorNetwork.__str__` as DOT and add explicit `to_dot`;
  - do not incompatibly override Symbolica’s inherited `to_latex`.
- Provide Typst rendering through the optional `gammaloop[typst-display]` extra using `typst>=0.15,<0.16`. Explicit HTML/SVG calls raise an install-guidance `ImportError` when absent; notebook display silently falls back to existing LaTeX/text.
- Direct Idenso functions continue returning normal Symbolica expressions. Rich display is obtained through Spenso objects, `spenso.formatted(expression)`, or `spenso.as_tensor(expression)`.

## Tests and rollout

- Test payload round-trips between native Spynso, Tydenso Wasm, and Tymbolica, including attachments, nested function remapping, malformed headers, trailing bytes, and rejection before registry mutation.
- Assert both repositories resolve one identical Symbolica source revision.
- Verify Tymbolica core and Rubi contain no Spenso/Idenso dependencies.
- Verify the Tydenso Wasm graph contains neither GMP/MPFR nor GammaLoop’s native workspace hack.
- Compile every Tymbolica, Rubi, and Tydenso example, test document, and manual; test semantic MathML output, SVG output, Typst HTML phantom alignment, notation overrides, and optional-renderer fallback.
- Copy Tydenso into GammaLoop first, then finalize and push the Tymbolica cleanup to `main`. Finally replace GammaLoop’s temporary local dependency with that exact pushed commit and validate the GammaLoop change atop `simplify-spenso-api`.
- Preserve the MIT license throughout.
Time to Start Worker time Duration Time to finish Idle
Config 6s 3s 3s 10s 6s
Eval 11s 54s 54s 1m05s 0s
Build 1m03s 6h24m57s 3h46m43s 3h47m46s 2h09m53s
Test 2h19m14s 23m47s 1h30m12s 3h49m27s 1m08s
Deploy - - - - 0s
Suite 6s 6h49m42s - - 2h11m10s

Timeline

Config Eval Build Test Failed Retried Compressed gap
0s1m2h11m2h12m2h13m2h14m2h15m2h16m2h17m2h18m2h19m2h20m2h21m2h22m2h23m2h24m2h25m2h26m2h27m2h28m2h29m2h30m2h31m2h32m2h33m2h34m2h35m2h36m2h37m2h38m2h39m2h40m2h41m2h42m2h43m2h44m2h45m2h46m2h47m2h48m2h49m2h50m2h51m2h52m2h53m2h54m2h55m2h56m2h57m2h58m2h59m3h0m3h1m3h2m3h3m3h4m3h5m3h6m3h7m3h8m3h9m3h10m3h11m3h12m3h13m3h14m3h15m3h16m3h17m3h18m3h19m3h20m3h21m3h22m3h23m3h24m3h25m3h26m3h27m3h28m3h29m3h30m3h31m3h32m3h33m3h34m3h35m3h36m3h37m3h38m3h39m3h40m3h41m3h42m3h43m3h44m3h45m3h46m3h47m3h49m