Repository navigation
Ariadne: a load:ed module's on_tick: runs at its mount - #904
Merged
Merged
Conversation
- (quit [code]): AppRuntime::register_quit() binds `on: quit` and the verb; the first close request's code is exit_code(). ari run/snapshot/check and arigl (window and --terminal) exit with it; snapshot stops on the frame the document quit. - (assert cond [message [data]]): a builtin raising AssertionError (a new class under Exception), "assertion failed[: message]"; its traceback ends at the form. - tests: block (name -> program) captured by the loader; Runtime::run_program runs a program on the action lane and reports how it ended to a callback. - ari test [--tap] [--timeout S] [--frames N] doc.ari...: each document headless until it quits, its tests have run, N frames, or the timeout. Fails on a non-zero quit, an uncaught error, a failed or warning load, a failed test, or a timeout. One line per document with what failed and in which program; TAP with --tap; exit 1 on failure. Network flags and settling as snapshot's. - Action failure warnings name their program; resident ones their lane. - Docs: ARIADNE.md §13, the exceptions table, the developer guide.
…s modules (#894) - functions: (top level): a program of (defun ...) forms that every program in the document's scope can call (init:, on:, residents, key bindings, tests:); anything else is skipped with a warning. import: merges a library's functions. - load: functions: [names] | name | "*": grants the parent's functions to the module, each with the functions it calls; a module gets none otherwise, and its own functions: stay inside it. Code, not authority: a granted function runs chrooted to the module. - Mechanism: Widget::functions (FunctionScope) on the root and every mount wrapper; the runtime keeps a function-scope stack beside the mount scopes and runs the scope's prelude ahead of each program (actions, residents, run_program, init:, mount init:). - The free-head preflight is scope-aware and scans function bodies and mount init:. - Docs: ARIADNE.md §6.6.
- Loader: expand_load captures the fragment's on_tick: onto the mount wrapper (Widget::tick_script), as it does init:. A fragment's on_key:, on_pointer: and on_signal: now load with a warning instead of being dropped silently: input and signals stay the outermost document's (docs/ARIADNE.md §6.3). - Runtime: one tick resident per mount sub-prefix, owner-tagged, chrooted there with the mount's FunctionScope prelude, on <owner>#tick@<sub-prefix>, woken each drain by post_tick. Started on the mount's first frame, after its init:. A reconcile keeps it when the new tree has the same mount and program, and stops it otherwise. A repeated mount's instance stops when its outermost repeat: count drops below it. - A failing module tick is reported as on_tick: of mount '<sub-prefix>'. The preflight and the channel lint scan a mount's on_tick:. - Tests: AriadneModuleTick.* (ariadne_host_test), AriTest.AModulesOnTickRuns. - Docs: ARIADNE.md §2.3, §2.4, §6.3, §7.4.
transfix
added a commit
to cy-pca/cypkg
that referenced
this pull request
Oct 30, 2026
main.ari now only composes. It mounts search.ari and package.ari with load: and grants each three holes: args (read-only), view and nav. Each module owns its state, imports its view (views.ari) and logic (lib.ari), and runs its own requests in its on_tick (transfix/libcvc#904). Its views reach a parsed reply through holes that grant a subtree (#905). A hidden mount doesn't start until shown, so Open sets view as well as nav.open, and that starts the package module. tests/modules/ mounts each module alone against the fixture through the same holes (9 search, 8 package tests, from the old whole-document logic tests), and tests/modules.sh runs them with ari test. tests/logic.sh, which ran ari test on a copy of main.ari, goes. lib.ari gains int-or, so a module loaded without its holes (ari check) doesn't fail its init. Every snapshot frame and interactive step is unchanged.
…-tick The locks spawn context (#865) makes resident contexts shared and built by make_action_context: a mount's tick resident is made the same way, chrooted to its sub-prefix.
…illing stepped_solve::impl did f.assign(nv, f[0]): the value is a reference into f, and libc++'s assign frees the old buffer before filling the new one, so on macOS every entry was read from freed memory (Fem.SteppedPoissonMatchesTheOneShotSolve, rel diff 6.7e268 in the macOS recipe lanes). libstdc++ and MSVC copy the value first, so Linux and Windows passed.
Takes #903's fix for the stepped Poisson solve in place of the same fix made here.
This was referenced Oct 30, 2026
transfix
enabled auto-merge (squash)
October 31, 2026 05:13
transfix
pushed a commit
that referenced
this pull request
Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
load:ed module'son_tick:now runs. Before this, a module'sinit:ran but itson_tick:was ignored with no warning, so a module could not own a loop (cy-pca/cypkg's request loop, for one) and so could not be tested on its own.Stacked on #900 (functions for modules). Retarget to master once that merges.
Loader (
expand_load): captures the fragment'son_tick:onto the mount wrapper asWidget::tick_script, the same way it capturesinit_script. A non-scalar one gets a warning.Runtime: one tick resident per mount sub-prefix (
MountTick). Each one:kill_ownerreaps it with the Runtime;FunctionScopeprelude defined once before its loop;<owner>#tick@<sub-prefix>;post_tick, coalesced like the document's tick.ensure_residentnow takes the chroot and the prelude; the 4-argument form keeps the document's behaviour.Lifetime:
init:(and its holes), so the first tick sees whatinit:seeded.repeat:count drops below it. With a nested repeat, an instance whose inner count drops keeps running until the next reconcile.Errors: a failing or killed module tick is reported once, as
on_tick: of mount '<sub-prefix>' resident [...].ari testfails the document on it.Checks: the load-time free-head preflight and the channel lint now scan a mount's
on_tick:.Decision:
on_key:,on_pointer:andon_signal:stay with the outermost document. A fragment that declares one now loads with a warning instead of having it silently ignored. Raw input and signals belong to the document:A module reacts to its own widgets. The parent passes on anything else through a
link:hole, which the module'son_tick:can read. This is written up in docs/ARIADNE.md §6.3.Docs: ARIADNE.md §2.3 (residents), §2.4 (the warning's lane name), §6.3 (a module's programs and the input-lane decision) and §7.4 (the order: holes, then
init:, then the tick; reconcile and repeat lifetime).Tests
ariadne_host_testAriadneModuleTick.*:init:, with the functions its mount granted, and cannot reach the parent's state; the document's own tick runs beside it;on_key:andon_signal:load with warnings.ari_test_command_testAriTest.AModulesOnTickRuns: a parent document's test waits for the module to tick 3 times, and a module whose tick asserts false failsari test, with the mount named.