physicsnemo / rules
Cursor rule3.3k starsChanged 12 months agoApache-2.0View on GitHub
Every model must have non-regression tests comparing outputs against reference data saved in .pth files, using realistic tensor shapes and pytest parameterization.
Trending
Quiet since September.about the whole repository
Who's talking about NVIDIA/physicsnemo
- NVIDIA/warp“Add restart support to CG and CR”GitHub · Jul 27, 2026 · 1 reactions
- NVIDIA/earth2studio“StormScope MeteoSat Europe”GitHub · Jul 20, 2026 · 1 reactions
- NVIDIA/earth2studio“feat: add CosmoDownscaling diagnostic model (ERA5 -> COSMO-REA6/REA2)”GitHub · Jun 26, 2026 · 1 reactions
- Rekin226/aquascope“Generative downscaling of CMIP6 (CorrDiff-style) to daily catchment forcing for the climate playbook”GitHub · Sep 2, 2026
- Rekin226/aquascope“Flood-extent surrogate: a 2D shallow-water emulator (PhysicsNeMo) so the flood playbook can say where the …”GitHub · Sep 2, 2026
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub (15 times).
On GitHub · 15
- Jul 27, 2026Add restart support to CG and CR — NVIDIA/warp1 reaction · 7 comments
- Jul 20, 2026StormScope MeteoSat Europe — NVIDIA/earth2studio1 reaction · 4 comments
- Jun 26, 2026feat: add CosmoDownscaling diagnostic model (ERA5 -> COSMO-REA6/REA2) — NVIDIA/earth2studio1 reaction · 5 comments
- Sep 2, 2026Generative downscaling of CMIP6 (CorrDiff-style) to daily catchment forcing for the climate playbook — Rekin226/aquascope0 reactions
- Sep 2, 2026Flood-extent surrogate: a 2D shallow-water emulator (PhysicsNeMo) so the flood playbook can say where the water goes, research-grade — Rekin226/aquascope0 reactions
10 more on GitHub
- Jul 21, 2026[BUG] PyTorch 2.13 breaks tensorclass construction in TensorDict 0.13.0 — pytorch/tensordict0 reactions · 1 comment
- Jun 21, 2026Add PhysicsNeMo compatibility smoke gate — emgun/universal_simulator0 reactions
- Jun 21, 2026Add ecosystem compatibility showcase card — emgun/universal_simulator0 reactions
- May 19, 2026[Add] PhysicsNeMo (NVIDIA/physicsnemo) — PyTorchKR/landscape0 reactions · 3 comments
- Mar 11, 2026[Stacked] Adds GLOBE Model updates for 3D + Dual Tree Traversal Acceleration — peterdsharpe/physicsnemo0 reactions
- Feb 27, 2026ML-Benchmark prediction submission: [CorrDiff-TW1-orog] — WCRP-CORDEX/ml-benchmarksays it tested it0 reactions
- Jan 23, 2026ML-Benchmark prediction submission: [CorrDiff-TW1] — WCRP-CORDEX/ml-benchmarksays it tested it0 reactions · 11 comments
- Jan 20, 2026Vendorize Apache 2.0 Nvidia Downscaling Code — ai2cm/ace0 reactions · 1 comment
- Jan 2, 2026Optimization: Gradient checkpointing for deep processor layers — openclimatefix/graph_weather0 reactions · 1 comment
- Nov 7, 2025[Ecosystem] Nvidia PhysicsNeMo — pytorch-fdn/ecosystem0 reactions · 9 comments
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository30 other files it gives its agents.
- .cursor/rules/mod-000a-reusable-layers-belong-in-nn.mdcCursor rule
- .cursor/rules/mod-000b-complete-models-belong-in-models.mdcCursor rule
- .cursor/rules/mod-001-use-physicsnemo-module-as-base-class.mdcCursor rule
- .cursor/rules/mod-002a-experimental-models-belong-in-experimental.mdcCursor rule
- .cursor/rules/mod-002b-add-deprecation-warnings-to-model.mdcCursor rule
- .cursor/rules/mod-002c-remove-deprecated-model-from-codebase.mdcCursor rule
- .cursor/rules/mod-003a-missing-or-incomplete-docstring.mdcCursor rule
- .cursor/rules/mod-003b-docstring-must-use-raw-string-prefix.mdcCursor rule
- .cursor/rules/mod-003c-missing-required-class-docstring-sections.mdcCursor rule
- .cursor/rules/mod-003d-missing-required-method-docstring-sections.mdcCursor rule
- .cursor/rules/mod-003e-tensor-shapes-must-use-latex-math-notation.mdcCursor rule
- .cursor/rules/mod-003f-callback-functions-must-have-code-block-specification.mdcCursor rule
- .cursor/rules/mod-003g-inline-code-must-use-double-backticks.mdcCursor rule
- .cursor/rules/mod-003h-parameters-must-be-documented-on-single-line.mdcCursor rule
- .cursor/rules/mod-003i-docstrings-should-include-cross-references.mdcCursor rule
- .cursor/rules/mod-003j-docstrings-should-include-examples-section.mdcCursor rule
- .cursor/rules/mod-003k-add-high-level-comments-for-complex-tensor-operations.mdcCursor rule
- .cursor/rules/mod-004-model-code-is-not-self-contained.mdcCursor rule
- .cursor/rules/mod-005-invalid-or-missing-tensor-shape-validation.mdcCursor rule
- .cursor/rules/mod-006-invalid-or-missing-jaxtyping-tensor-annotations.mdcCursor rule
- .cursor/rules/mod-007a-cannot-add-required-parameters-without-defaults.mdcCursor rule
- .cursor/rules/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper.mdcCursor rule
- .cursor/rules/mod-007c-cannot-change-return-types-of-public-methods.mdcCursor rule
- .cursor/rules/mod-008a-model-missing-constructor-attributes-tests.mdcCursor rule
- .cursor/rules/mod-008c-model-missing-checkpoint-loading-test.mdcCursor rule
- .cursor/rules/mod-009-avoid-string-based-class-selection.mdcCursor rule
- .cursor/rules/mod-010-avoid-splatted-kwargs-in-constructors.mdcCursor rule
- .cursor/rules/mod-011-use-proper-optional-dependency-handling.mdcCursor rule
- physicsnemo-discoverSkill
- physicsnemo-shard-tensorSkill
The file
We split this mod-008b-model-missing-non-regression-test-with-reference-data.mdc into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 6
When creating tests for models, rule MOD-008b must be followed.
- Distinctive: line 12
Every model must have non-regression tests that:
- Distinctive: line 14
Run forward pass with test data
- Very specific: line 18
Use pytest parameterization to test multiple configurations
- Distinctive: line 19
Test tensors must have realistic shapes (no singleton dimensions except batch)
- Distinctive: line 20
Test data should be meaningful and representative of actual use cases
- Distinctive: line 22
All public methods (not just forward) need similar non-regression tests
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: Every model must have non-regression tests comparing outputs against reference data saved in .pth files, using realistic tensor shapes and pytest parameterization.
alwaysApply: false
---
When creating tests for models, rule MOD-008b must be followed. Explicitly reference "Following rule MOD-008b, which requires non-regression tests with reference data..." when implementing test cases.
## MOD-008b: Model missing non-regression test with reference data
**Description:**
Every model must have non-regression tests that:
1. Instantiate the model with reproducible random parameters
2. Run forward pass with test data
3. Compare outputs against reference data saved in a `.pth` file
Requirements:
- Use `pytest` parameterization to test multiple configurations
- Test tensors must have realistic shapes (no singleton dimensions except batch)
- Test data should be meaningful and representative of actual use cases
- Compare actual tensor values, not just shapes
- All public methods (not just forward) need similar non-regression tests
**Critical:** Per MOD-002a, models cannot move out of experimental without these
tests.
**Rationale:**
Non-regression tests with reference data catch subtle numerical changes that
could break reproducibility. Simply checking output shapes is insufficient to
detect algorithmic changes or numerical instabilities. Comparing against
saved reference values ensures the model produces consistent results across code
changes.
**Example:**
```python
@pytest.mark.parametrize("device", ["cuda:0", "cpu"])
@pytest.mark.parametrize("config", ["default", "custom"])
def test_my_model_non_regression(device, config):
"""Test model forward pass against reference output."""
if config == "default":
model = _instantiate_model(MyModel, input_dim=64, output_dim=32)
else:
model = _instantiate_model(
MyModel,
input_dim=64,
output_dim=32,
hidden_dim=256
)
model = model.to(device)
# Load reference data (meaningful shapes, no singletons)
data = torch.load(f"test/models/data/my_model_{config}_v1.0.pth")
x = data["x"].to(device) # Shape: (4, 64), not (1, 64)
out_ref = data["out"].to(device)
# Run forward and compare values
out = model(x)
assert torch.allclose(out, out_ref, atol=1e-5, rtol=1e-5)
```
**Anti-pattern:**
```python
# WRONG: Only testing output shapes
def test_my_model_bad(device):
model = MyModel(input_dim=64, output_dim=32).to(device)
x = torch.randn(4, 64).to(device)
out = model(x)
assert out.shape == (4, 32) # NOT SUFFICIENT!
# WRONG: Using singleton dimensions
def test_my_model_bad(device):
x = torch.randn(1, 1, 64) # WRONG: Trivial shapes
# WRONG: No parameterization
def test_my_model_bad():
model = MyModel(input_dim=64, output_dim=32) # Only tests defaults
```
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

