Repository navigation
docs: explain graph memoization and independent node state - #790
Draft
pengpengyi92 wants to merge 1 commit into
Draft
pengpengyi92 wants to merge 1 commit into
pengpengyi92 wants to merge 1 commit into
Conversation
Signed-off-by: Pengyi Peng <74917296+pengpengyi92@users.noreply.github.com>
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.
Summary
Fixes #391.
Add a Graph Memoization section and TOC entry to the graph concepts page:
memoize=False, scopedcsp.memoize(False), and theimportant non-recursive graph opt-out behavior;
force_memoizeand factoryobject considerations;
and actually runs both counters.
Scope: one documentation file, 57 additions. No runtime, API, dependency or
native-code change. This is independent of the configured-realtime docs in #788.
Validation
runtime node start counts, per-node/scoped opt-out, non-recursive graph opt-out,
force_memoize, fresh state across runs/reused graph structure, helper-object
sharing and unhashable-argument fallback. The extra probes are local verification,
not new upstream test files.
python -m pytest csp/tests/test_graph_mem_cache.py csp/tests/impl/wiring csp/tests/test_engine.py::TestEngine::test_realtime_flag -q -rs-> 28 passed, 2 skipped (Numba unavailable).
python -m mdformat --check docs/wiki/concepts/CSP-Graph.md-> passed.python -m codespell_lib docs/wiki/concepts/CSP-Graph.md-> passed.git diff --check-> passed.Windows / Python 3.12.14; checked-out Python sources with official CSP 0.19.1
Windows wheel native libraries. No C++ rebuild, Linux/macOS matrix, full
service-dependent suite or performance benchmark was run. Local evidence does
not imply upstream CI success or maintainer acceptance.
Draft for maintainer scope/wording review; no engine behavior change proposed.