feat: evalWarm (warm-cache eval) + recordedDeps#1
Merged
Merged
Conversation
…ntical, S1 machinery)
…ancements - README: document evalWarm and recordedDeps (signatures, semantics, examples), add them to the ToC, and add an Acar (self-adjusting computation) provenance row - README: fold in the neron traversal-order stable-contract note and the "D over I over P" wording, and refresh the test count (163 tests / 19 suites) - lib/eval.nix: rewrite the new-primitive comments in house style — drop project-internal seam labels, spec-section refs, and brittle line-number references; keep the Acar citation
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.
Two additive pure-Nix evaluator primitives in
lib/eval.nix. Purely additive —eval/evalDebugbehaviour is unchanged, and the existing suites stay byte-green.evalWarm— relocatable warm-cache evaluator for incremental re-evaluation. A leaf attribute of a clean node (isClean id) whose value is present inpriorResultsis served from the cache without forcing its compute function; everything else evaluates cold.children/derived-childrenare never warm-served — tree structure is always recomputed, so a dirty descendant stays reachable through freshly-materialized parents. Thin wrapper overeval: they share the per-attribute evaluator (evalAttr), andevalcarriespriorResults/isCleanas warm-off defaults, soevaland warm-offevalWarmare byte-identical. (Informed by Acar's self-adjusting computation.)recordedDeps— first-class projection of a consumer's declared read-edges (declaredEdges id). Pure and memo-free. The dynamic read-set is only recoverable viaevalDebug's fresh-self-per-get, which defeats memoization, so the declared edges are the inspectable contract.The first commit factors the duplicated root/child attribute loops into one shared
evalAttrwith optional warm params —evalstays byte-identical (the existingevalsuite gates it).163 tests (152 existing + 11 new across the
eval-warmandrecorded-depssuites), TDD red-first, treefmt-clean.