Skip to content

Stepwise 1.3 — offline PWA, growth analysis

Choose a tag to compare

@nirbhayagga nirbhayagga released this 04 Sep 23:11
· 2 commits to main since this release

Stepwise now works with no network at all — and can measure its own algorithms.

Offline PWA

  • A service worker precaches the entire app, so after one visit it loads and runs fully offline. Install it from the browser and it behaves like a native app (proper 192/512 px and maskable icons included).
  • Inter and JetBrains Mono are now bundled with the app instead of loaded from Google Fonts. Stepwise makes zero third-party requests, and the Content-Security-Policy is now pure 'self'.
  • New deploys are picked up automatically on the next visit.

Growth Analysis (new module)

  • Runs every sorting algorithm across input sizes 8–512 and four input distributions (random, sorted, reversed, few-unique), counts real operations, and plots the curves against each other on a log or linear scale.
  • The empirical order is fitted from the measurements alone — least-squares in log–log space — and reported next to each curve (bubble sort comes out ≈ Θ(n²) with slope n^2.01; merge sort ≈ Θ(n log n)). Compare it with what the complexity card claims.
  • A plain-English primer on O, Ω, Θ and amortized analysis sits below the chart.

Recurrences

  • Complexity cards now show the recurrence relation where one drives the analysis — merge sort reads T(n) = 2T(n/2) + Θ(n) ⇒ Θ(n log n) — Master case 2; quicksort, closest pair, Hanoi, naive Fibonacci, subsets and permutations got theirs too.

Tests: 122 passing, including cross-checks that the growth measurements agree with the visualizer's own metrics and that the empirical classifier recovers n, n log n and n² on stereotypical inputs.