Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/altaidevorg/rules-for-ai/nnx_functional_api__split_merge_state_update_graphdef_git clone --depth 1 https://github.com/altaidevorg/rules-for-aiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/altaidevorg/rules-for-ai/nnx_functional_api__split_merge_state_update_graphdef_)<a href="https://agentmods.dev/rules/altaidevorg/rules-for-ai/nnx_functional_api__split_merge_state_update_graphdef_"><img src="https://agentmods.dev/badge/rules/altaidevorg/rules-for-ai/nnx_functional_api__split_merge_state_update_graphdef_.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00033 | $0.04767 |
| Opus 5 | $0.00016 | $0.02384 |
| Sonnet 5 | $0.00007 | $0.00953 |
| Haiku 4.5 | $0.00003 | $0.00477 |
Grade A, and why
nnx_functional_api__split_merge_state_update_graphdef_ scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 334 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Chapter 6: NNX Functional API (split/merge/state/update/graphdef)
In the previous chapter, we saw how NNX Lifted Transforms like nnx.jit and nnx.grad automatically handle the state management required to apply JAX transformations to stateful nnx.Module methods. This chapter dives into the fundamental building blocks that make those lifted transforms possible: the NNX Functional API. This set of functions (nnx.split, nnx.merge, nnx.state, nnx.update, nnx.graphdef) provides the explicit bridge between NNX's object-oriented, stateful nnx.Module instances and JAX's functional programming model which requires pure functions operating on immutable pytrees.
Motivation: Manual Control over State for JAX Interoperability
JAX transformations operate on pure functions and immutable data structures (pytrees). nnx.Module instances, however, are stateful Python objects containing mutable nnx.Variable / nnx.VariableState attributes. To apply a JAX transform like jax.jit or jax.grad directly, we need to:
- Separate the static, structural information of the Module (its class types, attribute names, nested structure) from its dynamic state (the actual values held in Variables).
- Define a pure function that accepts the dynamic state as an explicit argument (a JAX pytree).
- Apply the JAX transformation to this pure function.
- Potentially recombine the static structure and the (possibly updated) dynamic state to get a Module instance back.
While Lifted Transforms automate this, the Functional API provides the manual controls (split, merge, etc.) to perform these steps explicitly. Understanding this API is crucial for advanced use cases, debugging, and comprehending how NNX integrates with JAX at a fundamental level.
Central Use Case: Manual JIT Compilation of a Module Method
Let's manually JIT-compile a method of an nnx.Module using the functional API. Compare this to the automated approach shown with nnx.jit in the previous chapter.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 334 lines · 33 tokens per session scan A 729b71f17034
nnx_functional_api__split_merge_state_update_graphdef_ is a cursor rule published in the GitHub repository altaidevorg/rules-for-ai (2 stars, last pushed 1y ago), licensed MIT. It adds 33 tokens to every session and 4,767 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
llm-layer
LLM provider implementation patterns.
tensorflow
TensorFlow: Keras, model training, production deployment.
cursorrules
Cursor rule "cursorrules" from Clarity-Digital-Twin/brain-go-brrr, covering .cursorrules - brain-go-brrr project (fixed architecture), rule #1: no parallel implementations ever, experiments/trainanything.py - must be thin, rule #2: check before building and rule #3: normalization is critical.
006_Program_of_Thought_Tutorial
DSPY 3 Program of Thought Tutorial - Production code reasoning system from official DSPy 3.0.1 tutorial.
standards-data-eng
Mandatory standards for Python and SQL data pipelines.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.