ParetoStackpareto-stackdocshpc-labs

What changed in 0.4.3

Changes in 0.4.3, compared with 0.4.2. The full history of every version is on the all versions page.

0.4.3 (2026-10-27)

  • Offline mode for the assistant: /offline on (and paretostack models offline on|off|status, kept in the per-user config) checks the local runtime and model, looks for a newer model or runtime when the network is reachable, offers the (re)download (asks, skippable), then turns the cloud backends off for the session; /offline off restores. paretostack/offline.py; the fake-Ollama tests in tests/test_offline_mode.py.
  • The assistant (pareto) looks and reads like Claude Code: a welcome box in the brand colours (logo, product line, version, machine, project, model, tips), a coloured prompt, Tab completion of the slash commands and sample names, /help grouped by product. New commands: /pick (the sample picker), /cloud (check, probe, the offline package optimizers, the tuning plans; anything that creates copies asks first), /hw and /pcb (when the build has the chip line), /doctor, /models, /keys, /cost, /status, /version. The catalogue and colours are in paretostack/branding.py.
  • Fix: an install or an update no longer replaces a sample file the customer already has under ~/ParetoStack/sample (an edited sample survived only the Windows .exe installer): new samples and new files are added, edited files are kept and listed (copy_samples in lib-ensure.sh; the Windows share installer does the same).
  • Wider proof rules for the C/C++ loop pass (OpenMP, pipelining, unrolling): loop variables declared before the loop (the rewritten forms leave the original's final value), an empty init, literal / scalar / constant strides, <= bounds, bounds with member chains and casts, comma declarator lists, arrays indexed by the loop variable plus an invariant base (2-D nests by row), if / else bodies of the same statement forms, reads of another array at an offset (guarded), and sequential reductions into INTEGER scalars (unrolled and pipelined forms only). A floating-point reduction is refused: measured on the GB10, GCC fuses s += a * b into an FMA in the original loop and not in the unrolled copies, one ulp apart. On OpenCV core + imgproc and CPython's Objects (3 793 loops) the pass now rewrites 87 loops unrolled / 38 pipelined / 74 parallel, from 25 / 17 / 25.
  • Three more tricks, all bit-exact: source-level loop unrolling by 4 (cpp:unroll, L1) and software pipelining (cpp:swp, L2: the reads of element i+1 before the store of element i, behind the parallel loop's runtime alias guard) for the proven element-wise C/C++ loops (one transform per loop: OpenMP, then pipelining, then unrolling); inlining, unrolling + peeling and modulo-scheduling axes in the L0 flag tuner (inline, unroll-peel, swp) and as GCC candidates of the build search (unroll, inline, swp).
  • Three samples from the CPython exploration: py_workloads (the study's 13 pure-Python kernels as one program), lambda_py_workloads and gcf_py_workloads (the same kernels as a CPU-bound Lambda / Cloud Function worker: the samples for the cloud presets — package offline, C port, tuning plan, sandbox). In the packages and the tours (example.sh workloads).
  • paretostack examples pick [NAME PRESET] [--product software|cloud|chip]: a menu to choose a sample (the list is long) and a preset with a spread of settings (quick = fast mode bit-exact, bit-exact full measurement, accuracy contract, autonomous search, local AI review, cloud AI review; build search for a codebase sample), then the exact command is shown and run. example.sh / example.cmd with no argument open it on a terminal (all is still the tour); the chat has /examples pick. Product-aware (docs/SAMPLE_PICKER.md): the cloud product adds the cloud presets (deployment package offline, with a C port, tuning plan, sandbox tuning, cloud check) on the function samples; the chip product has its own samples (hw_, pcb_) and presets (analyze, quick / full / rewrites / proven / strength synthesis search, PCB analyze / route); the console's gallery shows every preset's command.
  • AI usage ledger: every AI call ParetoStack makes (analysis, chat, models/keys tests) appends one line of COUNTS to ~/.cache/paretostack/ai_ledger.jsonl (model, purpose, project, input / output / cache tokens, dollars when reported or estimated from a configured price and then flagged, seconds, success; never the prompt, the answer or code). paretostack ai-usage [--project P] [--days N] [--json] prints the totals by model and purpose and the tokens per VERIFIED win (wins from the Strategy Memory; none means none). Tokens of an external agent driving the command line are not in it. docs/AI_USAGE.md; tests/test_ai_ledger.py (6).
  • Audit: the 0.3.7 suite ran with no AI model in the loop (by construction: paretostack run reaches a model only with --ai, default none); tests/test_ai_isolation.py (3) keeps it true; a run-time tripwire on the word_filter example saw no model access and no ledger entry. docs/AI_USAGE.md.
  • packaging/token_ab.py: the A/B harness for the token-saving claim (the same agent with and without paretostack, every result judged by the sample's verify recipe, capped spending, plan without --go); tests/test_token_ab.py (5).
  • Recipes can define build candidates: builds: {stock, baseline, variants: [{key, title, configure, flags, lto, pgo, network, contract}], only} composed on the generator's baseline (buildgen.recipe_builds); a contract: true candidate is left out of a bit-exact search.
  • search --builds-only: the build candidates without the source scan (a C / C++ codebase's Python files are not transform candidates).
  • Verifier: the Mann-Whitney p uses the exact distribution for small samples (up to 10 per side, no ties). The normal approximation floored at p = 0.012 for 5 against 5 non-overlapping passes (exact: 0.008), so a recipe with 5 repeats could never pass the p < 0.01 gate; the OpenCV 5 study found it.
  • Tests: the build-generator test accepts the explicit -march the generator derives on Arm cores the compiler does not know.
  • Fast mode: a noisy machine gets at most 2 extra pairs (extra_pairs) before the conservative estimate decides; the full mode keeps 8.
  • Doctor and Java on macOS (found in the macOS trial, docs/MACOS_TRIAL.md): paretostack doctor lists macOS as experimental instead of MISSING and shows arm64 for Apple silicon; the JDK check runs javac -version and java -version (macOS ships stubs that exist but fail), and says why; a Java project or examples run java_box_sums without a working JDK now stops with "Java is not usable on this machine: ... install a JDK" instead of ending in "too few successful runs". tests/test_doctor_mac_java.py (4).