Skip to content

Releases

v0.40.1-beta.2

v0.40.1-beta.2 Pre-release
Pre-release

Choose a tag to compare

@Abohamada24 Abohamada24 released this 04 Dec 07:40
4552df4

Pre-release (beta). The stable release stays v0.40.0.

  • Fix: Ans after a matrix result. Ans2 used to give a wrong symbolic answer, and Ans + MAT[[..]] was rejected. Matrix results are now stored in Ans, so Ans2, Ans+MAT[[..]], Ans^2, Ans^-1, det(Ans) and inv Ans work.
  • Fix: Ans with nothing stored now shows a short message instead of turning into the letters A, n, s.
  • Fix: re-running an input that was already cached did not update Ans.
  • Tests: campaign adds category ans (11 cases), nothing loosened.

Full list in CHANGELOG.md.

v0.40.1-beta.1

v0.40.1-beta.1 Pre-release
Pre-release

Choose a tag to compare

@Abohamada24 Abohamada24 released this 03 Dec 21:51
1433200

v0.40.1-beta.1

  • Weekly feedback round (Dec 2-3 tester sends), fixed as general classes:
  • Fix (matrix eval, general class): typing or pasting MAT[[..]] in the main input said "MAT مش مفهومة" - the smart route re-prefixed MAT onto text that already had it (MATMAT[[..]]). Bare MAT[[1,2],[3,4]] now evaluates to the matrix, MAT+MAT / MATMAT / 2MAT compute, MATRIX|[[..]] works, and the matrix screen defaults to eval when no operation is picked instead of "عملية غير معروفة".
  • Fix (Gamma): Gamma(5) and Gamma(n) were rejected as "مش دالة معروفة" even though the parser already mapped them to the gamma function - the raw-text word check ran before the mapping. Gamma(5) = 24, Gamma(1/2) = sqrt(pi), Gamma(n) stays symbolic.
  • Fix (Laplace, general class): laplace tan(t) and ttan(t) hung until the timeout and showed nothing. Two root causes: sympy's transform call had no time cap inside the Laplace path (now capped with budget inheritance like the rest of the engine), and the f=g/t helper recursed forever multiplying by t (now guarded: only when t is truly in the denominator, depth-capped). Functions with no Laplace transform now get a clear "مفيش تحويل لابلاس للدالة دي" with the reason (divergent integral, e.g. tan's poles at pi/2 + kpi) in under a second, instead of a blank box.
  • Fix (typed integrals): "the integral of x^2 from 0 to 1" died on the word "the" (leading "the" is now stripped before keyword detection), and "integral of x^2 from x=0 to x=1" failed computing because bounds kept their "x=" prefix (bounds now accept variable assignments).
  • Fix (piecewise, general class): \begin{cases} input showed "□ خانة فاضية". LaTeX cases blocks now parse into Piecewise: f(x) = \begin{cases} x^2 & x>0 \ -x & x<=0 \end{cases} defines f and f(2) = 4; a row without a condition (or "otherwise") is the default branch.
  • Fix (integral of a saved function call): integral L(t^2) dt said "Could not solve" - a defined function whose body is a definite integral substitutes into an unevaluated Integral inside the integrand, which the engine could not handle. Inner definite integrals from user calls are now evaluated first (same path as the overview, with the positive-parameter assumption), so integral L(t^2) dt = 2t/s^3 + C and integral x*L(1) dx = x^2/(2s) + C.
  • Fix (AI path, network/503): the online AI helper now retries twice with backoff (1.2s, 3.5s) on network errors and 5xx before giving up, and on final failure tries the same problem on the local offline engine (e.g. matrix inverse) and shows that answer with a note instead of only an error.
  • Tests: campaign grows with matrix 1 -> 6, laplace 4 -> 6, new gamma 3/3, new piecewise 2/2, integral-definite 16 -> 18, call-def 37 -> 39. No existing expectation loosened.

v0.40.0

Choose a tag to compare

@Abohamada24 Abohamada24 released this 03 Dec 14:10
daeb691

v0.40.0

  • Stable release. Rolls up beta.1-beta.10: the Numeric math keypad on every screen outside the main calculator; user-defined functions done right (Greek names, save-without-evaluate, tap-to-call, calls evaluate with Arabic steps and stated convergence conditions, nested calls, persistence across restarts); parametric improper integrals with per-case conditions (Laplace/Gamma family, e.g. integral_0^inf te^(-st) dt = 1/s^2 with s > 0 stated); the integration variable always follows the d__ in the input; plot steps use the curve's own variable; reserved-name guard (C/c/P/p vs nCr/nPr); hang guards restored for huge trig powers; and two generations of orphaned-compute-thread fixes so a timed-out calculation can never slow the rest of the session. Every change above shipped with its own tests; full battery green on this build (campaign 27 categories, ui 72/72, reader and fuzz suites, upd 34/0).

v0.40.0-beta.9

v0.40.0-beta.9 Pre-release
Pre-release

Choose a tag to compare

@Abohamada24 Abohamada24 released this 03 Dec 02:44
113a474
  • Guard (reserved names, general class): defining a user function or routine named C, c, P or p silently collided with the nCr/nPr notation - C(3,4) kept computing the binomial coefficient (0) instead of calling the user function, with no hint anything was wrong. Defining one of these names now fails with a clear message: "⚠ الاسم C محجوز (nCr)" (and nPr for P/p). Lowercase included because the notation parser is case-insensitive (c(3,4) was also binomial). Prefixed names like P3 are unaffected, and nCr/nPr still work (C(10,3) = 120).
  • Fix (orphaned compute threads, general class): when live typing timed out mid-computation, the killed worker thread could leave its own grandchild threads (the engine's internal per-stage caps) running as zombies - invisible to the app, still burning CPU and slowing every later calculation on the phone. The engine now keeps a registry of every compute thread it spawns (_CAPPED) with a _kill_compute() that injects the deadline exception into all of them; the app calls it (precompute_clean) on the first non-live keystroke path and from cancel_all, so a new calculation never competes with an orphaned one.
  • Guard restored (hang guards): sin(x)^100000 and d/dx sin(x)^100000 are rejected again with the "الأس كبير جداً" message instead of being allowed through. A trig-specific exception (limit 1000000, added in v0.29) had silently disabled the power guard for trig bases since Nov 30; huge trig powers are exactly the family that hangs integration on the phone. The limit is 1000 for all bases again; nothing legitimate needs sin(x)^1000+.
  • Tests: campaign call-def grows 31 -> 37 cases (4 reserved-name rejections, nCr intact after rejection, routine-name rejection); hang-guards back to 13/13 with the guard restored.
  • Test harness disclosure (tests/campaign.py only, no app code): the runner no longer pre-runs self-driving live cases through the uncapped main-thread path (new SKIP: prefix) - the phone never runs live queries that way, and doing so left sticky interpreter state after a mid-computation kill that slowed later cases ~2.5x and made 'divergent stays divergent' fail (4.2s, "≈ Integral(...)" instead of "متباعد" at 2.0s). run() now calls api.precompute_clean() first (mimics the phone's next-keystroke kill) and the err_raw append was restored after a diagnostic edit had orphaned it. A CASE=name filter was added for single-case runs. Full battery re-run green: campaign all 27 categories, ui 72/72, paste/valid/rep 0 fails, gen 61, equiv 192, scan 32, words 352, input_ode 124, dxocr sync, upd 34, fuzz 43 fast + big-noise.

v0.40.0-beta.10

v0.40.0-beta.10 Pre-release
Pre-release

Choose a tag to compare

@Abohamada24 Abohamada24 released this 03 Dec 07:35
f037906
  • Fix (orphan compute threads, root cause, general class): after a timed-out heavy calculation (e.g. pressing Calculate on integral sin(x)^50 dx), the whole app could stay ~2.5x slower for the rest of the session. Root cause: nested time caps were not budgeted - the engine's outer 12s cap wrapped an inner 14s one, so when the outer fired, the inner worker thread was orphaned and kept spinning on the GIL (one spinning Python thread halves every other thread's speed). Two fixes: (1) nested caps now inherit the parent's remaining budget, so an inner cap never outlives its outer; (2) the timeout kill is no longer fire-and-forget - it injects the deadline and waits (bounded, 3 x 0.3s) for the thread to actually die, re-injecting when a bare except inside sympy swallows the first injection. Verified: the poison reproduction now ends with zero leftover threads and full-speed follow-up computations; e^(s*t) on [0,inf) correctly says متباعد right after a killed sin(x)^50 run.
  • Fix (latent crash path): a timed-out multi-integral could raise SystemExit out of the engine (the kill used SystemExit, which the caller's except Exception cannot catch). Kills now uniformly use the engine's _Deadline and surface as TimeoutError('slow'), which callers already handle.
  • Tests: full battery re-run green, unchanged expectations - campaign all 27 categories (hang-guards 13/13, live 5/5, integral-indefinite 18/18, integral-param 10/10, integral-definite 16/16, limit 9/9, plot 11/11, call-def 37/37, transform-theorems 19/19, and the rest), ui 72/72, paste/valid/rep 0 fails, gen 61, equiv 192, scan 32, words 352, input_ode 124, dxocr sync, upd 34, fuzz 43 fast + big-noise. No app-visible behavior changed except the removal of the slowdown and the crash path.

v0.40.0-beta.8

v0.40.0-beta.8 Pre-release
Pre-release

Choose a tag to compare

@Abohamada24 Abohamada24 released this 02 Dec 21:13
4a8c04c

v0.40.0-beta.8

  • Fix (plot steps, general class): plotting an expression whose variable is not x - for example plot t^2-3t, or plotting a user-defined function defined in t like G(t)=t^2-3t - re-parsed the input for the roots/y-intercept steps WITHOUT the variable normalization the curve itself gets. The root check solved in the wrong variable (found nothing) and the intercept check substituted x=0 into a t-expression, got a non-finite answer, and printed a false step "الدالة غير معرّفة عند x = 0" for a perfectly fine parabola. Now the extras use the same single-symbol-to-x normalization as the curve: plot t^2-3t and plot G(t) show roots 0, 3 and f(0) = 0. A real gap still shows correctly: plot 1/t still says undefined at x = 0.
  • Docs: ROADMAP.md was stale - it listed shipped features (sub-steps v0.20, number facts v0.24, Bode/Nyquist/phase portraits v0.25, user-defined functions v0.40) as future plans, and listed the derivative of sin(|x|) as a known gap even though it works (cos(|x|)·sign(x)). Updated to match reality.
  • Tests: campaign plot grows 7 -> 11 cases (t-variable roots+intercept, x regression, real-gap pin, user-def t plot end to end). Engine change is 2 lines in plot extras; curve points untouched.

v0.40.0-beta.7: linear combinations and exponentials in user-function calls evaluate, with convergence conditions

Choose a tag to compare

@Abohamada24 Abohamada24 released this 02 Dec 15:42
e6f4e18

v0.40.0-beta.7

  • Ahmed's beta.6 finding (L(t + e^(2t) - 5) showed the substituted integral but never evaluated it): calls and typed integrals with linear combinations (sums, differences, constants) and exponentials e^(at) in the argument now evaluate, and the steps state the DERIVED convergence condition per case, not a blanket s>0. His example: L(t + e^(2t) - 5) = 1/s^2 + 1/(s-2) - 5/s with "s > 2" stated; L(e^(3t)) = 1/(s-3) with "s > 3"; L(te^(a*t)) = 1/(s-a)^2 with "s > a"; L(cos(2t)) = s/(s^2+4); L(5) = 5/s; L(t^3-2t+1) = 6/s^4 - 2/s^2 + 1/s.
  • How (general class, engine _cond_ladder): on [0,inf) integrals with symbolic parameters, split the integrand into additive terms, fold each term's exponential factors into one decay-rate expression (like s-2 from e^((2-s)t)), integrate each term against a fresh positive symbol, then substitute back. A term whose condition would need a parameter to be negative (like e^(s*t), needing s<0) is rejected, so truly divergent cases still say متباعد. The whole ladder has a 9-second budget so pathological inputs cannot hang the phone.
  • Clear failure instead of silence (Ahmed's ask): if a call's substituted integral cannot be evaluated, the app now says so plainly - "مقدرتش أحسب التكامل الناتج" with steps showing the substituted integral and the reason - instead of showing the raw integral with no explanation.
  • Tests: campaign call-def grows 20 -> 31 cases (linear-combo value+condition, e^(3t) value+condition, symbolic te^(at) value+condition, cos(2t), constant, cubic, no blanket-s>0 phrasing, clear-failure pin; plus a typed-integral s>2 case in integral-param, now 10/10). Neighbors re-run: integral-definite 16/16, undefined 4/4, plot 7/7. UI suite 68 -> 72 checks with the end-to-end combo flow (type L(t+e^(2t)-5), get the value, condition in steps, no Integral dump). One disclosure: fuzz gate unchanged (43 fast + big-noise alone, both ALL GREEN; the big case always runs ~90s, which exceeded the 110s wall when combined - no regression).

v0.40.0-beta.6: user-defined function calls substitute and evaluate, with steps

Choose a tag to compare

@Abohamada24 Abohamada24 released this 02 Dec 14:28
b326fa7

v0.40.0-beta.6

  • Ahmed's beta.5 finding, fixed as a general class: calling a saved user function now substitutes the call argument correctly AND evaluates the result, for any function name, any number of arguments, and any argument expression. His example: with L(t) = integral_0^inf te^(-st) dt saved, L(t^2) = 2/s^3, L(t) = 1/s^2, L(1) = 1/s, L(sin(t)) = 1/(s^2+1) - each with the positive-parameter assumption stated in the steps, and no raw Piecewise/arg(s) dump anywhere. beta.5 returned the raw unevaluated integral (with the parameter not even substituted when the function's own variable was the integral's d__ variable).
  • Substitution rule (general, no special-casing of any name): when the function's formal parameter is the bound variable of an integral/sum/limit in its body, the factors that contain ONLY the parameter are replaced wholesale by the call argument; kernel factors carrying other symbols (like e^(-s*t)) and the limits are untouched. Distinct-parameter and multi-argument bodies use plain substitution as before.
  • Steps on user-function calls (Ahmed's ask): the result of calling a saved function now shows its steps in Arabic, starting with the substitution line (the call shown as the substituted integral), followed by the integration steps.
  • Definitions now accept more body forms, all tested: diff(x^3,x) and "derivative of" (D(x) = diff(x^3,x) -> D(2) = 12), typed sums/products in the Sigma/Pi pipe and paren forms (S(n) = sum k from 1 to n -> S(10) = 55; factorial body), and limits in both "lim u->0" and limit(f,u,0) forms (sin(u)/u -> 1).
  • Nested calls between user functions work (N(t) = L(t) + 1, then N(t^2) = 1 + 2/s^3), and definitions still persist across restarts.
  • Tests: campaign gains a 20-case call-def category pinning arbitrary names (Latin and Greek), 1-3 arguments, integral/sum/limit/derivative bodies, nested calls, restart replay, shadow-restore, no-dump, and steps-showing-substitution (20/20). Neighboring categories re-run: integral-param 9/9, integral-definite 16/16, undefined 4/4, plot 7/7.
  • Tests: the UI suite grows 61 -> 68 checks with the end-to-end flow pinned in the real page: seeded definitions L and lap survive a simulated restart, typing L(t^2) in the math box computes 2/s^3 with the substitution step shown, and no definition body is dumped into the input. One pre-existing row was re-pinned (never loosened): after the engine now evaluates these calls, the "replayed" check for Gamma(x) asserts the user-definition step marker (استدعاء) instead of the old raw-integral text - a stronger signal that the saved definition, not the built-in, answered. This build scores 68/68.

d/dx v0.40.0-beta.5

d/dx v0.40.0-beta.5 Pre-release
Pre-release

Choose a tag to compare

@Abohamada24 Abohamada24 released this 02 Dec 13:34
929f5b4
  • Ahmed's pick-to-call ask: in the definitions screen (دوالي), tapping a saved function now inserts ONLY its name with empty parentheses into the main input - Gamma( ) with the cursor blinking between them, in normal math mode with the Casio pad - so a value typed right away computes the call (Gamma(2) = 1). The whole stored definition is no longer dumped into the input on a pick. The ✎ button still loads the full text for editing and 🗑 still deletes.
  • The dialog hint now says in words that tapping the name calls the function, answering "استدعي الدالة منين".
  • Greek function names insert correctly in any spelling the definition was saved with (Gamma, Γ, Delta, Δ, ...), not as separated letters.
  • Ahmed's integral finding (same example family): improper integrals with symbolic parameters now evaluate instead of coming back unevaluated or mislabeled - integral_0^inf e^(-st) dt = 1/s, integral_0^inf te^(-st) dt = 1/s^2, integral_0^inf e^(-t) t^(alpha-1) dt = Gamma(alpha). The engine retries with the parameters assumed positive (the convergence condition) and states that assumption in the steps. Truly divergent cases still say so (1/x on [0,1], e^(st) on [0,inf)).
  • The integration variable always comes from the d__ in the input (dt, dx, du); every other letter is treated as a parameter, for single and improper integrals alike. This fixes beta.4's visible mix-up where the fallback answer integrated over x instead of t. Verdict on his question: the x-mix-up was triggered by beta.4's engine changes making an old hardcoded-x fallback reachable (0.39.0 kept t but answered 'divergent'); the failure to evaluate 1/s at all is a pre-existing gap that 0.39.0 also had - the correct value is new in this build.
  • Tests: campaign gains 9 integral-param cases pinning the three mandated integrals over dt/dx/du, the no-mix-up rule, the stated assumption, divergent-stays-divergent, and numeric results unchanged (9/9). Neighboring categories re-run on the touched engine: integral-definite 16/16, undefined 4/4, plot 7/7.
  • Tests: the suite grows 52 -> 61 checks with the mandated pick flow pinned end to end: open the definitions screen, tap the saved Gamma row, dialog closes, math mode stays, input shows exactly Gamma(□) with the placeholder selected (no "integral"/"=" dump), typing 2 gives Gamma(2), and solving returns 1. This build scores 61/61; beta.4's dialog had no tap-to-call action at all (only edit/dump and delete), so the new rows fail there at 'pick-row' (no .udtx element).

v0.40.0-beta.4

v0.40.0-beta.4 Pre-release
Pre-release

Choose a tag to compare

@Abohamada24 Abohamada24 released this 02 Dec 12:47
03f2d00
  • Fix Ahmed's two beta.3 findings on the same example (Γ(α) = ∫_0^∞ e^(-t) t^(α-1) dt): (1) ✓ tried to SOLVE the definition instead of only saving it, and it was never saved at all; (2) after saving there was no obvious way back to the definitions screen.
  • Root cause 1: the input converter dropped everything before an ∫ sign, so "Γ(α) = ∫..." reached the engine as a bare integral and got evaluated. Now a definition left side (name(args) =) is preserved, Greek letters included, so it is detected and stored as a definition, never evaluated on save.
  • Definitions accept Greek names and variables (Γ(α), Δ(u), ...), typed in the math box or pasted as unicode characters.
  • A definition whose right side is an integral in words ("integral of ... from ... to ...") is stored as an unevaluated integral, so Γ(α) = ∫_0^∞ e^(-t) t^(α-1) dt defines fine; calling it with a number computes the value: Γ(2) = 1, Γ(5) = 24 (evaluated with a 6-second cap so hard integrals cannot hang; the numeric value is always computed).
  • Root cause 2 (not saved at all): the live preview had already computed the definition, so ✓ took the cached result and skipped the save path. The cached path now saves too.
  • Way back: after a definition saves, the definitions screen (دوالي) reopens showing the new entry, and it is still reachable any time from the keypad MENU. Definitions persist across restarts (stored list replayed into the engine on start) - tested by wiping the engine and replaying.
  • A user definition named Γ/gamma now shadows the built-in gamma function only while it exists; deleting it restores the built-in (Γ(3) = 2).
  • Tests: the UI runner (tools/uirun.py) now serves real engine answers (/run endpoint, like tests/ui/srv.py) so flows can be tested end to end. The suite grows 37 -> 52 checks with the mandated flow: type Γ(α) = ∫... in the editor, ✓ saves without evaluating (no ≈ anywhere), the definitions screen reopens with Γ listed and closes, Γ(2) computes 1 from the main input, and after a simulated restart (engine wiped, replay from storage) Γ(2) still computes 1. This build scores 52/52; 0.39.0 has no action bar and fails at 'bar-exists' (and the old engine answered the same definition with "Gamma مش دالة معروفة" or evaluated it).