Fold front-end demand into the one multi-owner claim set - #337
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
|
Core's own front-end now drives the visibility channels through a board callback rather than from inside Worth carrying into the vocabulary here: whatever replaces That callback is a second migration site alongside blockr.dock#417, and a small one — its whole body is one One asymmetry to flag, because it runs the other way. The stack callback states what it requires only from an observer, never synchronously as it is set up, and that is fine against |
|
On retiring
The reason is the ordering: the card is rendered into So neither shiny's flag nor a front-end's acknowledgement is early enough to stop the first render. The only signal that is early enough is what the front-end has already declared it intends to show — which is demand. Gating rendering on Two jobs I would not fold in with that, because I have not measured them:
|
|
To state the end point the two comments above only circle: once The One cost worth naming rather than discovering later: dock already folds two The part that genuinely resists is the gate declaration, and it is the reason the bundle cannot simply be deleted. A payload applies at |
780518d to
f6e2f8a
Compare
|
Heads up from #343 / #344: this branch reintroduces the load-time evaluation that #343 reports. Measured on The block in the collapsed stack ( That is a small fix on its own — the seed from #344 ports over — but it points at something this PR comes close to solving and stops just short of. The declaration is right; the timing is notReplacing "has anyone written demand" with What stays inferred is when. Board updates apply at The Registration is the moment core can knowThe callback list is the one thing
Happy to take this on if you would rather it were folded in here than tracked separately. |
f6e2f8a to
ab01dd9
Compare
|
This carries into https://github.com/orgs/BristolMyersSquibb/discussions/489 with one change, along the lines of the last comment above: take the gating declaration and the opening claim from the board rather than |
|
Revised request, replacing my comment above. The declaration moves to callback registration rather than Changes for this PR:
|
The per-block `required` channel expressed the same evaluation demand the `sustain` claims already carry, so core distinguished the front-end from every other consumer and the channel could quietly become multi-writer. The front-end now claims under an owner label like anyone else, asks for bare construction with `construct`, and declares that it drives visibility by writing that label into the new board-wide `visibility$gate` channel -- inferring gating from claims instead would let a consumer asking about one block park every other block on an ungated board.
The `gate_stacks()` callback landed on main while this branch was open and drove `visibility$required` directly. It now claims the blocks of every open stack under an owner label of its own, holds the collapsed ones built with a `construct` request, and declares the gate on the first accordion report -- the same moment the old slot writes used to activate gating.
The #343 fix declares what core renders open as the board server is set up, which the claim set expresses as the gate declaration plus an opening claim. The declaration stays a synchronous write: a payload only applies at the end of the flush it is written in, by which time the window it closes has passed.
A payload applies at the end of the flush it is written in, after the first flush has decided what to construct, so a front-end whose only channel is `update` could not declare in time. The declaration now rides the one thing board_server() holds before any flush: a callback returns gate_claim(owner, blocks), and core seeds that opening claim as it runs the callbacks. That replaces the synchronous visibility$gate() write and the gate_claimed latch, which existed only because an opening claim sent by payload was indistinguishable from none until it landed. The stack gate declares its open stacks this way and no longer sends a `construct` for collapsed blocks, which built all of them in one flush where the background pass paces them.
ab01dd9 to
ef1d124
Compare
|
All four applied, rebased onto current The callback returns The The One side effect to review: callbacks now run through For BristolMyersSquibb/blockr.dock#420, the shape to follow is its callback returning |
Core calls only json_read() and json_write_str(), both in the CRAN release, and resolving the GitHub remote was the one step in dependency install that needed the GitHub API.
A board is eager by default and evaluates every block; a front-end makes it lazy by returning eager(owner, blocks) from its callback, and the blocks any owner holds eager are what a lazy board evaluates. The same word now names the payload component, so the `sustain` component becomes `eager` and gate_claim() becomes eager(), and the docs stop describing the declaration as driving visibility. Nothing here has been released, so the rename carries no deprecation.
Summary
Evaluation demand was expressed two ways depending on who asked: a front-end wrote the per-block
visibility$requiredtri-state, while everyone else went through the board update payload components. This retires the front-end's channel — the blocks it needs are heldeagerunder an owner label like any other consumer's, so core no longer distinguishes its demand from a code export's and the demand axis cannot silently become multi-writer the wayrequireddid (the defect behind #320).The tri-state was doing three jobs. Only evaluation demand folds into the owner-keyed
eagersets; the other two are separated rather than absorbed:eager(owner, blocks), and core seedsblocksas that owner's eager set as it runs the callbacks. A board whose callbacks return none stays eager, so a consumer holding one block eager cannot park every other block on it, whichtest-visibility-gating.Rpins.constructcomponent from Construction demand has no home in the board update payload #333. The stack callback sends none for collapsed blocks, sinceconstructbuilds everything it names in one flush; they are left to the background pass until Buildconstructrequests in the order given, paced by core, instead of a background pass #367.visibleis untouched, as are the render gate andgate_fulfilled(), which Render a block when the front-end claims it, not whenvisiblereports it painted #366, Buildconstructrequests in the order given, paced by core, instead of a background pass #367 and Move freezing intoupdateand drop thevisibilitybundle from the callback signature #368 replace. The backlog still holds on the front-end's own eager blocks being painted, since blocks held by anyone else are ones nobody is putting on screen.The declaration rides callback registration because that is the one moment
board_server()holds before any flush without a round trip. A payload applies atpriority = -Inf, after the first flush has decided what to construct, so an opening eager set sent that way arrives too late by construction. Seeding it at registration also removes the need to tell "has not declared yet" from "holds nothing": thegate_claimedlatch is gone, and the three construction-order tests it protected fail if the opening set is instead made to land at the end of the first flush.The payload component was
sustainand the declarationgate_claim(); both are noweager, since a lazy board evaluates exactly the blocks some owner holds eager. Neither name was released.Migration
visibility$required[[id]](TRUE)update(list(eager = list(<owner> = list(add = id))))visibility$required[[id]](FALSE)update(list(eager = list(<owner> = list(rm = id)))); a built block stays built, and an unbuilt one is left to the background passvisibility$required[[id]]non-NAmakes the board lazyeager("<owner>", <opening ids>), on its own or as one element of the list it returnsvisibility$visible[[id]](…),visibility$frozen[[id]](…)Breaking for blockr.dock, which drives
requiredinmark_cards_built()andshow_cards(); blockr.dock#420 adopts it. The neighboring unreleased 0.1.4 NEWS entries (#333, #320, #338) described their changes in terms of therequiredchannel and were corrected in place.The merge queue checks blockr.dock against its adoption PR rather than
main, which cannot start against this branch, and blockr.dag and blockr.assistant against throwaway branches whoseRemotespin that PR, since their e2e tests boot a dock app:Fixes #321