Sitelet https://github.com/dojoengine/origami/pull/125
Skip to content

chore: drop origami_algebra and cubit, port origami_defi to fixed, set version 1.8.0 - #125

Merged
bal7hazar merged 2 commits into
mainfrom
chore/drop-algebra-cubit-1.8.0
Sep 27, 2026
Merged

bal7hazar merged 2 commits into
mainfrom
chore/drop-algebra-cubit-1.8.0

Conversation

@bal7hazar

@bal7hazar bal7hazar commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Drop origami_algebra: crate, workspace member, CI job and README entry removed. The README now points readers to the nalgebra / glam packages on scarbs.xyz.
  • Port origami_defi from cubit to fixed 0.4.0 (registry). cubit is gone from the workspace, origami_defi is publishable and is in the CI packaging job.
  • Version 1.8.0 in [workspace.package], and <version> → 1.8.0 in every README.
  • Deleted the stale crates/random/Scarb.lock and crates/security/Scarb.lock. Rebased on feat(hexmap): origami_hexmap foundation (L0) #126 (hexmap), and origami_hexmap is marked publish = false (stubs until the facade lot). .snfoundry_cache is ignored.

API change (origami_defi)

Function names and argument order are unchanged. The Fixed type changes from cubit::f128::types::fixed::Fixed (Q64.64) to fixed::Fixed (Q32.32, { raw: i64 }, range [-2^31, 2^31)).

New public item: helpers::FixedStorePacking (StorePacking<Fixed, i64>). It lets the structs keep #[derive(starknet::Store)].

Each public function now documents its remaining domain limits in a # Domain section.

Audit follow-up (intermediate overflows where the result fits)

Each case is reproduced by a test with the exact failing input. Each test failed before the fix and passes after it.

finding test fix
continuous: initial_price / decay_constant continuous::test_price_small_decay divide by decay_constant last, on an exact 128-bit product (helpers::mul_div)
(same pattern) continuous: decay_constant * quantity / emission_rate continuous::test_price_large_quantity decay_constant * (quantity / emission_rate)
discrete: initial_price * (high - low) / (scale_factor - 1) discrete::test_price_large_initial_price mul_div, and exponents summed exactly with fixed::wide (one rescale)
logistic: limit + sold logistic::test_target_sale_time_large_max_sellable time_scale * ln_1p(2 sold / (limit - sold))

Gas (cairo-test, same inputs)

test cubit fixed (port) fixed (after audit fixes)
gda continuous ×4 432 270 65 260 65 150
gda discrete ×5 310 770 – 424 890 89 060 85 270
vrgda linear ×2 63 160 62 260 62 260
vrgda logistic target_price / pricing_basic / reverse 596 900 / 929 930 / 588 270 71 310 / 263 830 / 70 470 73 090 / 265 610 / 72 250
helpers days_convertions 37 290 9 680 9 680

All the original tests keep their inputs, expected values and tolerances.

🤖 Generated with Claude Code

…t version 1.8.0

- Remove the origami_algebra crate (superseded by nalgebra / glam on scarbs.xyz).
- Port origami_defi from cubit (Q64.64) to the registry package fixed 0.4.0 (Q32.32),
  with overflow-safe exp/ln formulations; defi becomes publishable.
- Set the workspace version to 1.8.0 and delete stale per-crate lockfiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bal7hazar
bal7hazar force-pushed the chore/drop-algebra-cubit-1.8.0 branch from 4cfab6e to 466e4a6 Compare September 27, 2026 13:45
- ContinuousGDA: divide by decay_constant last on a 128-bit product (mul_div) and
  compute the growth as decay_constant * (quantity / emission_rate).
- DiscreteGDA: sum the exponents exactly with fixed::wide and divide by
  scale_factor - 1 last on a 128-bit product.
- LogisticVRGDA: target sale time as time_scale * ln_1p(2 sold / (limit - sold)),
  which never forms limit + sold.
- Reproduction tests for each case, domain limits documented on the public functions.
- Housekeeping: ignore .snfoundry_cache, version 1.8.0 in the crate READMEs,
  origami_hexmap not published yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bal7hazar
bal7hazar merged commit c73fecc into main Sep 27, 2026
9 checks passed
@bal7hazar
bal7hazar deleted the chore/drop-algebra-cubit-1.8.0 branch September 27, 2026 13:55
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