mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper

mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper is a cursor rule for Cursor from NVIDIA/physicsnemo. It costs 29 tokens per session (713 once invoked), scanned A, original, Apache-2.0.

A compatibility rule for changing parameters in production machine-learning models. It requires old parameter names or versions to keep working through version tracking and a mapping layer.

In plain words
What is it for?
Use it when removing or renaming parameters in the specified model code, including updating version information and mapping old arguments to the new interface.
Why use it?
Changing a model's parameters can break saved model files and existing code. The rule provides a migration path so older models and callers continue to work.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

About the project

PhysicsNeMo is an open-source PyTorch framework for creating, training, and fine-tuning machine-learning models for physics, scientific computing, and engineering. Researchers and engineers use its reusable components and training recipes for applications such as aerodynamics, weather forecasting, structural mechanics, geophysics, and thermal design. The catalogue entries provide rules and skills for working with PhysicsNeMo projects.

NVIDIA/physicsnemo · 3,222 stars · on GitHub · developer.nvidia.com

Install

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.

agentmods
npx agentmods add rules/nvidia/physicsnemo/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper
Clone the repo
git clone --depth 1 https://github.com/NVIDIA/physicsnemo

Made for: Cursor.

Wrote 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.

agentmods badge for mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper

README.md
[![agentmods](https://agentmods.dev/badge/rules/nvidia/physicsnemo/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper.svg)](https://agentmods.dev/rules/nvidia/physicsnemo/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper)
Your own site
<a href="https://agentmods.dev/rules/nvidia/physicsnemo/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper"><img src="https://agentmods.dev/badge/rules/nvidia/physicsnemo/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 713 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.00713
Opus 5 $0.00015 $0.00357
Sonnet 5 $0.00006 $0.00143
Haiku 4.5 $0.00003 $0.00071

Measured 6d ago against content hash d47519e22285, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper 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 6d 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.

.cursor/rules/mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper.mdc · 87 lines

What it actually says

When removing or renaming parameters in production models, rule MOD-007b must be strictly followed. Explicitly reference "Following rule MOD-007b, which requires _backward_compat_arg_mapper for parameter changes..." when modifying model signatures.

MOD-007b: Cannot remove or rename parameters without compat mapper

Description:

For any model in physicsnemo/nn or physicsnemo/models, removing or renaming parameters is strictly forbidden without proper backward compatibility support.

If a parameter must be renamed or removed, the developer must:

  1. Increment __model_checkpoint_version__
  2. Add the old version to __supported_model_checkpoint_version__ dict
  3. Implement _backward_compat_arg_mapper classmethod to handle the mapping
  4. Maintain support for the old API for at least 2 release cycles

Rationale:

Removing or renaming parameters breaks existing checkpoints and user code. Proper version management and argument mapping ensures old checkpoints can still be loaded and users have time to migrate to the new API.

Example:

# Good: Proper backward compatibility for parameter rename
class MyModel(Module):
    __model_checkpoint_version__ = "2.0"
    __supported_model_checkpoint_version__ = {
        "1.0": (
            "Loading checkpoint from version 1.0 (current is 2.0). "
            "Parameter 'hidden_dim' renamed to 'hidden_size'."
        )
    }

    @classmethod
    def _backward_compat_arg_mapper(
        cls, version: str, args: Dict[str, Any]
    ) -> Dict[str, Any]:
        """Map arguments from older versions."""
        args = super()._backward_compat_arg_mapper(version, args)

        if version == "1.0":
            # Map old parameter name to new name
            if "hidden_dim" in args:
                args["hidden_size"] = args.pop("hidden_dim")

            # Remove deprecated parameters
            if "legacy_param" in args:
                _ = args.pop("legacy_param")

        return args

    def __init__(
        self,
        input_dim: int,
        hidden_size: int = 128,  # Renamed from 'hidden_dim'
    ):
        super().__init__(meta=MyModelMetaData())

Anti-pattern:

# WRONG: Renaming without backward compat
class MyModel(Module):
    __model_checkpoint_version__ = "2.0"
    # Missing: __supported_model_checkpoint_version__ and _backward_compat_arg_mapper

    def __init__(self, input_dim: int, hidden_size: int):  # Renamed!
        super().__init__(meta=MyModelMetaData())
        # WRONG: Old checkpoints with 'hidden_dim' will fail!

# WRONG: Not calling super() in mapper
class MyModel(Module):
    @classmethod
    def _backward_compat_arg_mapper(cls, version: str, args: Dict[str, Any]) -> Dict[str, Any]:
        # WRONG: Missing super()._backward_compat_arg_mapper(version, args)
        if "hidden_dim" in args:
            args["hidden_size"] = args.pop("hidden_dim")
        return args
Changes

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.

  1. 6d ago First seen · 87 lines · 29 tokens per session scan A d47519e22285

Subscribe to this mod's changes

mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper is a cursor rule published in the GitHub repository NVIDIA/physicsnemo (3,222 stars, last pushed yesterday), licensed Apache-2.0. It adds 29 tokens to every session and 713 once invoked, about $0.0001 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-30.