[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-nvidia-physicsnemo-cfd-create-custom-metric":3,"mdc-5nw2lu-key":44,"related-org-nvidia-physicsnemo-cfd-create-custom-metric":1566,"related-repo-nvidia-physicsnemo-cfd-create-custom-metric":1726},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":39,"sourceUrl":42,"mdContent":43},"physicsnemo-cfd-create-custom-metric","create custom metrics for CFD benchmarking","Create a custom metric for the PhysicsNeMo CFD benchmarking workflow. Use when the user wants to add a new evaluation metric, implement a custom error measure, compute force coefficients, or extend the benchmark with domain-specific quantities.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"nvidia","NVIDIA","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fnvidia.png",[12,16,19,20,23],{"name":13,"slug":14,"type":15},"Benchmarking","benchmarking","tag",{"name":17,"slug":18,"type":15},"Analysis","analysis",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"Simulation","simulation",{"name":24,"slug":25,"type":15},"Physics","physics",131,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fphysicsnemo-cfd","2026-07-14T05:33:34.319957","Apache-2.0",24,[32,33,34,35,36,8,37,38],"aerodynamics","cae","cfd","fluid-dynamics","nim","nvidia-warp","physicsnemo",{"repoUrl":27,"stars":26,"forks":30,"topics":40,"description":41},[32,33,34,35,36,8,37,38],"L​ibrary for using the models trained in PhysicsNeMo in Engineering and CFD workflows ","https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fphysicsnemo-cfd\u002Ftree\u002FHEAD\u002Fskills\u002Fphysicsnemo-cfd-create-custom-metric","---\nname: physicsnemo-cfd-create-custom-metric\ndescription: >-\n  Create a custom metric for the PhysicsNeMo CFD benchmarking workflow.\n  Use when the user wants to add a new evaluation metric, implement a custom\n  error measure, compute force coefficients, or extend the benchmark with\n  domain-specific quantities.\nlicense: Apache-2.0\n---\n\n# Create a Custom Metric\n\nGuide the user through adding a new metric to the benchmarking workflow.\n\n## Reference files to read first\n\n- `physicsnemo\u002Fcfd\u002Fpostprocessing_tools\u002Fmetric_registry.py` —\n  `register_metric`, `get_metric`, `MetricFn`\n- `physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fbuiltin\u002Fforces.py` — `drag_error`,\n  `lift_error` (dict-returning, mesh-based)\n- `physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fbuiltin\u002Fl2.py` — L2 metrics\n  (scalar-returning, numpy fallback)\n- `physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fmesh_bridge.py` —\n  `build_comparison_mesh`, `resolve_comparison_mesh_for_metric`\n- `physicsnemo\u002Fcfd\u002Fpostprocessing_tools\u002Fmetrics\u002Faero_forces.py` —\n  `compute_force_coefficients` (normals, areas, integration)\n- `workflows\u002Fbenchmarking\u002Fnotebooks\u002Fadding_a_new_metric.ipynb` —\n  end-to-end tutorial\n\n## Metric function signature\n\nMetrics are plain callables, no base class:\n\n```python\nMetricFn = Callable[..., float | dict[str, float]]\n```\n\n**Modern signature** (accepts extended engine kwargs):\n\n```python\ndef my_metric(\n    ground_truth: dict,      # canonical GT: {\"pressure\": ..., \"shear_stress\": ...}\n    predictions: dict,        # canonical predictions from decode_outputs\n    *,\n    case: Any = None,         # CanonicalCase from the dataset adapter\n    comparison_mesh: Any = None,  # PyVista mesh with GT + pred arrays attached\n    metric_dtype: str | None = None,  # \"cell\" or \"point\"\n    output: Any = None,       # OutputConfig with field name mappings\n    **_: object,              # absorb unknown kwargs\n) -> float | dict[str, float]:\n    ...\n```\n\n**Return types**:\n\n- `float` — single scalar value (e.g., L2 error)\n- `dict[str, float]` — multiple values; keys are auto-flattened by the\n  engine: `{\"error\": 0.1, \"pred\": 42.0}` from metric `side_force` becomes\n  `side_force_error` and `side_force_pred` in results\n\n## Step 1: Write the metric function\n\n### Simple array-based metric (no mesh needed)\n\n```python\nimport numpy as np\n\ndef mae_pressure(ground_truth, predictions, **_):\n    gt = np.asarray(ground_truth.get(\"pressure\", []), dtype=np.float64).ravel()\n    pred = np.asarray(predictions.get(\"pressure\", []), dtype=np.float64).ravel()\n    if gt.size == 0 or pred.size == 0 or gt.shape != pred.shape:\n        return float(\"nan\")\n    return float(np.mean(np.abs(gt - pred)))\n```\n\n### Mesh-based metric (uses normals, areas, geometry)\n\nUse ``resolve_comparison_mesh_for_metric`` (shared helper in\n``mesh_bridge``; do not copy a local ``_resolve_mesh``) to get the\ncomparison mesh, then access arrays:\n\n```python\nfrom physicsnemo.cfd.evaluation.metrics.mesh_bridge import resolve_comparison_mesh_for_metric\n\ndef my_force_metric(ground_truth, predictions, *, case=None, comparison_mesh=None,\n                    metric_dtype=None, output=None, **_):\n    mesh, dtype = resolve_comparison_mesh_for_metric(\n        predictions,\n        case=case,\n        comparison_mesh=comparison_mesh,\n        metric_dtype=metric_dtype,\n        output=output,\n    )\n    if mesh is None or output is None:\n        return float(\"nan\")\n\n    # Access fields by VTK array name from output config\n    p = mesh.cell_data[output.mesh_field_names[\"pressure\"]]\n    wss = mesh.cell_data[output.mesh_field_names[\"shear_stress\"]]\n\n    # Access mesh geometry\n    mesh = mesh.compute_normals().compute_cell_sizes()\n    normals = mesh[\"Normals\"]   # (N, 3)\n    areas = mesh[\"Area\"]        # (N,)\n\n    # Compute your metric...\n    return float(result)\n```\n\n## Step 2: Register the metric\n\n```python\nfrom physicsnemo.cfd.postprocessing_tools.metric_registry import register_metric\n\nregister_metric(\"my_metric\", my_metric_fn, domain=\"surface\")  # or \"volume\" or None\n```\n\n- `domain=\"surface\"` — only used when model's inference domain is surface\n- `domain=\"volume\"` — only used for volume inference\n- `domain=None` — domain-agnostic fallback\n- Same name can be registered for both domains with different functions (like `l2_pressure`)\n\n## Step 3: Use in benchmark config\n\nAdd the metric name to the `metrics` list:\n\n```python\nconfig = Config.from_dict({\n    ...\n    \"metrics\": [\"l2_pressure\", \"drag\", \"lift\", \"my_metric\"],\n    ...\n})\n```\n\nOr in YAML:\n\n```yaml\nmetrics:\n  - l2_pressure\n  - my_metric\n```\n\nPer-metric kwargs can be passed as a dict:\n\n```yaml\nmetrics:\n  - name: my_metric\n    some_param: 42\n```\n\n## Step 4: Make permanent (optional)\n\nAdd to `physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fbuiltin\u002F` and register from `builtin\u002F__init__.py`:\n\n```python\ndef register_my_metrics():\n    register_metric(\"my_metric\", my_fn, domain=\"surface\")\n\n# In __init__.py:\ndef register_all_builtin_metrics():\n    register_l2_metrics()\n    register_force_metrics()\n    register_physics_metrics()\n    register_my_metrics()  # add this\n```\n\n## Existing built-in metrics\n\n| Name | Domain(s) | Returns |\n|------|-----------|---------|\n| `l2_pressure` | surface, volume | `float` |\n| `l2_shear_stress` | surface | `dict` |\n| `l2_pressure_area_weighted` | surface | `float` |\n| `l2_velocity` | volume | `dict` |\n| `l2_turbulent_viscosity` | volume | `float` |\n| `drag` | surface | `dict` (error, true, pred) |\n| `lift` | surface | `dict` (error, true, pred) |\n| `continuity_residual_l2` | volume | `float` |\n| `momentum_residual_l2` | volume | `float` |\n\n## Gotchas\n\n- **Dict flattening**: if metric returns `{\"error\": 0.1, \"true\": 5.0}`,\n  engine stores as `metricname_error` and `metricname_true`. An empty\n  string key `\"\"` maps to just `metricname`.\n- **NaN handling**: return `float(\"nan\")` for failures; engine\n  accumulates NaN gracefully.\n- **Legacy fallback**: engine tries extended kwargs first; on\n  `TypeError` it falls back to `fn(gt, predictions, **mkwargs)` only.\n  Modern metrics should accept `**_` to absorb unknowns.\n- **Results JSON format**: `benchmark_results.json` is a plain\n  `list[dict]`, not `{\"results\": [...]}`.\n- **OutputConfig field names**: surface uses `output.mesh_field_names` \u002F\n  `output.ground_truth_mesh_field_names`; volume uses\n  `output.volume_mesh_field_names` \u002F\n  `output.ground_truth_volume_mesh_field_names`.\n",{"data":45,"body":46},{"name":4,"description":6,"license":29},{"type":47,"children":48},"root",[49,58,64,71,199,205,210,231,242,347,357,414,420,427,499,505,533,748,754,784,833,839,852,897,902,951,956,1012,1018,1038,1116,1122,1377,1383,1560],{"type":50,"tag":51,"props":52,"children":54},"element","h1",{"id":53},"create-a-custom-metric",[55],{"type":56,"value":57},"text","Create a Custom Metric",{"type":50,"tag":59,"props":60,"children":61},"p",{},[62],{"type":56,"value":63},"Guide the user through adding a new metric to the benchmarking workflow.",{"type":50,"tag":65,"props":66,"children":68},"h2",{"id":67},"reference-files-to-read-first",[69],{"type":56,"value":70},"Reference files to read first",{"type":50,"tag":72,"props":73,"children":74},"ul",{},[75,109,136,147,170,188],{"type":50,"tag":76,"props":77,"children":78},"li",{},[79,86,88,94,96,102,103],{"type":50,"tag":80,"props":81,"children":83},"code",{"className":82},[],[84],{"type":56,"value":85},"physicsnemo\u002Fcfd\u002Fpostprocessing_tools\u002Fmetric_registry.py",{"type":56,"value":87}," —\n",{"type":50,"tag":80,"props":89,"children":91},{"className":90},[],[92],{"type":56,"value":93},"register_metric",{"type":56,"value":95},", ",{"type":50,"tag":80,"props":97,"children":99},{"className":98},[],[100],{"type":56,"value":101},"get_metric",{"type":56,"value":95},{"type":50,"tag":80,"props":104,"children":106},{"className":105},[],[107],{"type":56,"value":108},"MetricFn",{"type":50,"tag":76,"props":110,"children":111},{},[112,118,120,126,128,134],{"type":50,"tag":80,"props":113,"children":115},{"className":114},[],[116],{"type":56,"value":117},"physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fbuiltin\u002Fforces.py",{"type":56,"value":119}," — ",{"type":50,"tag":80,"props":121,"children":123},{"className":122},[],[124],{"type":56,"value":125},"drag_error",{"type":56,"value":127},",\n",{"type":50,"tag":80,"props":129,"children":131},{"className":130},[],[132],{"type":56,"value":133},"lift_error",{"type":56,"value":135}," (dict-returning, mesh-based)",{"type":50,"tag":76,"props":137,"children":138},{},[139,145],{"type":50,"tag":80,"props":140,"children":142},{"className":141},[],[143],{"type":56,"value":144},"physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fbuiltin\u002Fl2.py",{"type":56,"value":146}," — L2 metrics\n(scalar-returning, numpy fallback)",{"type":50,"tag":76,"props":148,"children":149},{},[150,156,157,163,164],{"type":50,"tag":80,"props":151,"children":153},{"className":152},[],[154],{"type":56,"value":155},"physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fmesh_bridge.py",{"type":56,"value":87},{"type":50,"tag":80,"props":158,"children":160},{"className":159},[],[161],{"type":56,"value":162},"build_comparison_mesh",{"type":56,"value":95},{"type":50,"tag":80,"props":165,"children":167},{"className":166},[],[168],{"type":56,"value":169},"resolve_comparison_mesh_for_metric",{"type":50,"tag":76,"props":171,"children":172},{},[173,179,180,186],{"type":50,"tag":80,"props":174,"children":176},{"className":175},[],[177],{"type":56,"value":178},"physicsnemo\u002Fcfd\u002Fpostprocessing_tools\u002Fmetrics\u002Faero_forces.py",{"type":56,"value":87},{"type":50,"tag":80,"props":181,"children":183},{"className":182},[],[184],{"type":56,"value":185},"compute_force_coefficients",{"type":56,"value":187}," (normals, areas, integration)",{"type":50,"tag":76,"props":189,"children":190},{},[191,197],{"type":50,"tag":80,"props":192,"children":194},{"className":193},[],[195],{"type":56,"value":196},"workflows\u002Fbenchmarking\u002Fnotebooks\u002Fadding_a_new_metric.ipynb",{"type":56,"value":198}," —\nend-to-end tutorial",{"type":50,"tag":65,"props":200,"children":202},{"id":201},"metric-function-signature",[203],{"type":56,"value":204},"Metric function signature",{"type":50,"tag":59,"props":206,"children":207},{},[208],{"type":56,"value":209},"Metrics are plain callables, no base class:",{"type":50,"tag":211,"props":212,"children":217},"pre",{"className":213,"code":214,"language":215,"meta":216,"style":216},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","MetricFn = Callable[..., float | dict[str, float]]\n","python","",[218],{"type":50,"tag":80,"props":219,"children":220},{"__ignoreMap":216},[221],{"type":50,"tag":222,"props":223,"children":226},"span",{"class":224,"line":225},"line",1,[227],{"type":50,"tag":222,"props":228,"children":229},{},[230],{"type":56,"value":214},{"type":50,"tag":59,"props":232,"children":233},{},[234,240],{"type":50,"tag":235,"props":236,"children":237},"strong",{},[238],{"type":56,"value":239},"Modern signature",{"type":56,"value":241}," (accepts extended engine kwargs):",{"type":50,"tag":211,"props":243,"children":245},{"className":213,"code":244,"language":215,"meta":216,"style":216},"def my_metric(\n    ground_truth: dict,      # canonical GT: {\"pressure\": ..., \"shear_stress\": ...}\n    predictions: dict,        # canonical predictions from decode_outputs\n    *,\n    case: Any = None,         # CanonicalCase from the dataset adapter\n    comparison_mesh: Any = None,  # PyVista mesh with GT + pred arrays attached\n    metric_dtype: str | None = None,  # \"cell\" or \"point\"\n    output: Any = None,       # OutputConfig with field name mappings\n    **_: object,              # absorb unknown kwargs\n) -> float | dict[str, float]:\n    ...\n",[246],{"type":50,"tag":80,"props":247,"children":248},{"__ignoreMap":216},[249,257,266,275,284,293,302,311,320,329,338],{"type":50,"tag":222,"props":250,"children":251},{"class":224,"line":225},[252],{"type":50,"tag":222,"props":253,"children":254},{},[255],{"type":56,"value":256},"def my_metric(\n",{"type":50,"tag":222,"props":258,"children":260},{"class":224,"line":259},2,[261],{"type":50,"tag":222,"props":262,"children":263},{},[264],{"type":56,"value":265},"    ground_truth: dict,      # canonical GT: {\"pressure\": ..., \"shear_stress\": ...}\n",{"type":50,"tag":222,"props":267,"children":269},{"class":224,"line":268},3,[270],{"type":50,"tag":222,"props":271,"children":272},{},[273],{"type":56,"value":274},"    predictions: dict,        # canonical predictions from decode_outputs\n",{"type":50,"tag":222,"props":276,"children":278},{"class":224,"line":277},4,[279],{"type":50,"tag":222,"props":280,"children":281},{},[282],{"type":56,"value":283},"    *,\n",{"type":50,"tag":222,"props":285,"children":287},{"class":224,"line":286},5,[288],{"type":50,"tag":222,"props":289,"children":290},{},[291],{"type":56,"value":292},"    case: Any = None,         # CanonicalCase from the dataset adapter\n",{"type":50,"tag":222,"props":294,"children":296},{"class":224,"line":295},6,[297],{"type":50,"tag":222,"props":298,"children":299},{},[300],{"type":56,"value":301},"    comparison_mesh: Any = None,  # PyVista mesh with GT + pred arrays attached\n",{"type":50,"tag":222,"props":303,"children":305},{"class":224,"line":304},7,[306],{"type":50,"tag":222,"props":307,"children":308},{},[309],{"type":56,"value":310},"    metric_dtype: str | None = None,  # \"cell\" or \"point\"\n",{"type":50,"tag":222,"props":312,"children":314},{"class":224,"line":313},8,[315],{"type":50,"tag":222,"props":316,"children":317},{},[318],{"type":56,"value":319},"    output: Any = None,       # OutputConfig with field name mappings\n",{"type":50,"tag":222,"props":321,"children":323},{"class":224,"line":322},9,[324],{"type":50,"tag":222,"props":325,"children":326},{},[327],{"type":56,"value":328},"    **_: object,              # absorb unknown kwargs\n",{"type":50,"tag":222,"props":330,"children":332},{"class":224,"line":331},10,[333],{"type":50,"tag":222,"props":334,"children":335},{},[336],{"type":56,"value":337},") -> float | dict[str, float]:\n",{"type":50,"tag":222,"props":339,"children":341},{"class":224,"line":340},11,[342],{"type":50,"tag":222,"props":343,"children":344},{},[345],{"type":56,"value":346},"    ...\n",{"type":50,"tag":59,"props":348,"children":349},{},[350,355],{"type":50,"tag":235,"props":351,"children":352},{},[353],{"type":56,"value":354},"Return types",{"type":56,"value":356},":",{"type":50,"tag":72,"props":358,"children":359},{},[360,371],{"type":50,"tag":76,"props":361,"children":362},{},[363,369],{"type":50,"tag":80,"props":364,"children":366},{"className":365},[],[367],{"type":56,"value":368},"float",{"type":56,"value":370}," — single scalar value (e.g., L2 error)",{"type":50,"tag":76,"props":372,"children":373},{},[374,380,382,388,390,396,398,404,406,412],{"type":50,"tag":80,"props":375,"children":377},{"className":376},[],[378],{"type":56,"value":379},"dict[str, float]",{"type":56,"value":381}," — multiple values; keys are auto-flattened by the\nengine: ",{"type":50,"tag":80,"props":383,"children":385},{"className":384},[],[386],{"type":56,"value":387},"{\"error\": 0.1, \"pred\": 42.0}",{"type":56,"value":389}," from metric ",{"type":50,"tag":80,"props":391,"children":393},{"className":392},[],[394],{"type":56,"value":395},"side_force",{"type":56,"value":397}," becomes\n",{"type":50,"tag":80,"props":399,"children":401},{"className":400},[],[402],{"type":56,"value":403},"side_force_error",{"type":56,"value":405}," and ",{"type":50,"tag":80,"props":407,"children":409},{"className":408},[],[410],{"type":56,"value":411},"side_force_pred",{"type":56,"value":413}," in results",{"type":50,"tag":65,"props":415,"children":417},{"id":416},"step-1-write-the-metric-function",[418],{"type":56,"value":419},"Step 1: Write the metric function",{"type":50,"tag":421,"props":422,"children":424},"h3",{"id":423},"simple-array-based-metric-no-mesh-needed",[425],{"type":56,"value":426},"Simple array-based metric (no mesh needed)",{"type":50,"tag":211,"props":428,"children":430},{"className":213,"code":429,"language":215,"meta":216,"style":216},"import numpy as np\n\ndef mae_pressure(ground_truth, predictions, **_):\n    gt = np.asarray(ground_truth.get(\"pressure\", []), dtype=np.float64).ravel()\n    pred = np.asarray(predictions.get(\"pressure\", []), dtype=np.float64).ravel()\n    if gt.size == 0 or pred.size == 0 or gt.shape != pred.shape:\n        return float(\"nan\")\n    return float(np.mean(np.abs(gt - pred)))\n",[431],{"type":50,"tag":80,"props":432,"children":433},{"__ignoreMap":216},[434,442,451,459,467,475,483,491],{"type":50,"tag":222,"props":435,"children":436},{"class":224,"line":225},[437],{"type":50,"tag":222,"props":438,"children":439},{},[440],{"type":56,"value":441},"import numpy as np\n",{"type":50,"tag":222,"props":443,"children":444},{"class":224,"line":259},[445],{"type":50,"tag":222,"props":446,"children":448},{"emptyLinePlaceholder":447},true,[449],{"type":56,"value":450},"\n",{"type":50,"tag":222,"props":452,"children":453},{"class":224,"line":268},[454],{"type":50,"tag":222,"props":455,"children":456},{},[457],{"type":56,"value":458},"def mae_pressure(ground_truth, predictions, **_):\n",{"type":50,"tag":222,"props":460,"children":461},{"class":224,"line":277},[462],{"type":50,"tag":222,"props":463,"children":464},{},[465],{"type":56,"value":466},"    gt = np.asarray(ground_truth.get(\"pressure\", []), dtype=np.float64).ravel()\n",{"type":50,"tag":222,"props":468,"children":469},{"class":224,"line":286},[470],{"type":50,"tag":222,"props":471,"children":472},{},[473],{"type":56,"value":474},"    pred = np.asarray(predictions.get(\"pressure\", []), dtype=np.float64).ravel()\n",{"type":50,"tag":222,"props":476,"children":477},{"class":224,"line":295},[478],{"type":50,"tag":222,"props":479,"children":480},{},[481],{"type":56,"value":482},"    if gt.size == 0 or pred.size == 0 or gt.shape != pred.shape:\n",{"type":50,"tag":222,"props":484,"children":485},{"class":224,"line":304},[486],{"type":50,"tag":222,"props":487,"children":488},{},[489],{"type":56,"value":490},"        return float(\"nan\")\n",{"type":50,"tag":222,"props":492,"children":493},{"class":224,"line":313},[494],{"type":50,"tag":222,"props":495,"children":496},{},[497],{"type":56,"value":498},"    return float(np.mean(np.abs(gt - pred)))\n",{"type":50,"tag":421,"props":500,"children":502},{"id":501},"mesh-based-metric-uses-normals-areas-geometry",[503],{"type":56,"value":504},"Mesh-based metric (uses normals, areas, geometry)",{"type":50,"tag":59,"props":506,"children":507},{},[508,510,515,517,523,525,531],{"type":56,"value":509},"Use ",{"type":50,"tag":80,"props":511,"children":513},{"className":512},[],[514],{"type":56,"value":169},{"type":56,"value":516}," (shared helper in\n",{"type":50,"tag":80,"props":518,"children":520},{"className":519},[],[521],{"type":56,"value":522},"mesh_bridge",{"type":56,"value":524},"; do not copy a local ",{"type":50,"tag":80,"props":526,"children":528},{"className":527},[],[529],{"type":56,"value":530},"_resolve_mesh",{"type":56,"value":532},") to get the\ncomparison mesh, then access arrays:",{"type":50,"tag":211,"props":534,"children":536},{"className":213,"code":535,"language":215,"meta":216,"style":216},"from physicsnemo.cfd.evaluation.metrics.mesh_bridge import resolve_comparison_mesh_for_metric\n\ndef my_force_metric(ground_truth, predictions, *, case=None, comparison_mesh=None,\n                    metric_dtype=None, output=None, **_):\n    mesh, dtype = resolve_comparison_mesh_for_metric(\n        predictions,\n        case=case,\n        comparison_mesh=comparison_mesh,\n        metric_dtype=metric_dtype,\n        output=output,\n    )\n    if mesh is None or output is None:\n        return float(\"nan\")\n\n    # Access fields by VTK array name from output config\n    p = mesh.cell_data[output.mesh_field_names[\"pressure\"]]\n    wss = mesh.cell_data[output.mesh_field_names[\"shear_stress\"]]\n\n    # Access mesh geometry\n    mesh = mesh.compute_normals().compute_cell_sizes()\n    normals = mesh[\"Normals\"]   # (N, 3)\n    areas = mesh[\"Area\"]        # (N,)\n\n    # Compute your metric...\n    return float(result)\n",[537],{"type":50,"tag":80,"props":538,"children":539},{"__ignoreMap":216},[540,548,555,563,571,579,587,595,603,611,619,627,636,644,652,661,670,679,687,696,705,714,723,731,739],{"type":50,"tag":222,"props":541,"children":542},{"class":224,"line":225},[543],{"type":50,"tag":222,"props":544,"children":545},{},[546],{"type":56,"value":547},"from physicsnemo.cfd.evaluation.metrics.mesh_bridge import resolve_comparison_mesh_for_metric\n",{"type":50,"tag":222,"props":549,"children":550},{"class":224,"line":259},[551],{"type":50,"tag":222,"props":552,"children":553},{"emptyLinePlaceholder":447},[554],{"type":56,"value":450},{"type":50,"tag":222,"props":556,"children":557},{"class":224,"line":268},[558],{"type":50,"tag":222,"props":559,"children":560},{},[561],{"type":56,"value":562},"def my_force_metric(ground_truth, predictions, *, case=None, comparison_mesh=None,\n",{"type":50,"tag":222,"props":564,"children":565},{"class":224,"line":277},[566],{"type":50,"tag":222,"props":567,"children":568},{},[569],{"type":56,"value":570},"                    metric_dtype=None, output=None, **_):\n",{"type":50,"tag":222,"props":572,"children":573},{"class":224,"line":286},[574],{"type":50,"tag":222,"props":575,"children":576},{},[577],{"type":56,"value":578},"    mesh, dtype = resolve_comparison_mesh_for_metric(\n",{"type":50,"tag":222,"props":580,"children":581},{"class":224,"line":295},[582],{"type":50,"tag":222,"props":583,"children":584},{},[585],{"type":56,"value":586},"        predictions,\n",{"type":50,"tag":222,"props":588,"children":589},{"class":224,"line":304},[590],{"type":50,"tag":222,"props":591,"children":592},{},[593],{"type":56,"value":594},"        case=case,\n",{"type":50,"tag":222,"props":596,"children":597},{"class":224,"line":313},[598],{"type":50,"tag":222,"props":599,"children":600},{},[601],{"type":56,"value":602},"        comparison_mesh=comparison_mesh,\n",{"type":50,"tag":222,"props":604,"children":605},{"class":224,"line":322},[606],{"type":50,"tag":222,"props":607,"children":608},{},[609],{"type":56,"value":610},"        metric_dtype=metric_dtype,\n",{"type":50,"tag":222,"props":612,"children":613},{"class":224,"line":331},[614],{"type":50,"tag":222,"props":615,"children":616},{},[617],{"type":56,"value":618},"        output=output,\n",{"type":50,"tag":222,"props":620,"children":621},{"class":224,"line":340},[622],{"type":50,"tag":222,"props":623,"children":624},{},[625],{"type":56,"value":626},"    )\n",{"type":50,"tag":222,"props":628,"children":630},{"class":224,"line":629},12,[631],{"type":50,"tag":222,"props":632,"children":633},{},[634],{"type":56,"value":635},"    if mesh is None or output is None:\n",{"type":50,"tag":222,"props":637,"children":639},{"class":224,"line":638},13,[640],{"type":50,"tag":222,"props":641,"children":642},{},[643],{"type":56,"value":490},{"type":50,"tag":222,"props":645,"children":647},{"class":224,"line":646},14,[648],{"type":50,"tag":222,"props":649,"children":650},{"emptyLinePlaceholder":447},[651],{"type":56,"value":450},{"type":50,"tag":222,"props":653,"children":655},{"class":224,"line":654},15,[656],{"type":50,"tag":222,"props":657,"children":658},{},[659],{"type":56,"value":660},"    # Access fields by VTK array name from output config\n",{"type":50,"tag":222,"props":662,"children":664},{"class":224,"line":663},16,[665],{"type":50,"tag":222,"props":666,"children":667},{},[668],{"type":56,"value":669},"    p = mesh.cell_data[output.mesh_field_names[\"pressure\"]]\n",{"type":50,"tag":222,"props":671,"children":673},{"class":224,"line":672},17,[674],{"type":50,"tag":222,"props":675,"children":676},{},[677],{"type":56,"value":678},"    wss = mesh.cell_data[output.mesh_field_names[\"shear_stress\"]]\n",{"type":50,"tag":222,"props":680,"children":682},{"class":224,"line":681},18,[683],{"type":50,"tag":222,"props":684,"children":685},{"emptyLinePlaceholder":447},[686],{"type":56,"value":450},{"type":50,"tag":222,"props":688,"children":690},{"class":224,"line":689},19,[691],{"type":50,"tag":222,"props":692,"children":693},{},[694],{"type":56,"value":695},"    # Access mesh geometry\n",{"type":50,"tag":222,"props":697,"children":699},{"class":224,"line":698},20,[700],{"type":50,"tag":222,"props":701,"children":702},{},[703],{"type":56,"value":704},"    mesh = mesh.compute_normals().compute_cell_sizes()\n",{"type":50,"tag":222,"props":706,"children":708},{"class":224,"line":707},21,[709],{"type":50,"tag":222,"props":710,"children":711},{},[712],{"type":56,"value":713},"    normals = mesh[\"Normals\"]   # (N, 3)\n",{"type":50,"tag":222,"props":715,"children":717},{"class":224,"line":716},22,[718],{"type":50,"tag":222,"props":719,"children":720},{},[721],{"type":56,"value":722},"    areas = mesh[\"Area\"]        # (N,)\n",{"type":50,"tag":222,"props":724,"children":726},{"class":224,"line":725},23,[727],{"type":50,"tag":222,"props":728,"children":729},{"emptyLinePlaceholder":447},[730],{"type":56,"value":450},{"type":50,"tag":222,"props":732,"children":733},{"class":224,"line":30},[734],{"type":50,"tag":222,"props":735,"children":736},{},[737],{"type":56,"value":738},"    # Compute your metric...\n",{"type":50,"tag":222,"props":740,"children":742},{"class":224,"line":741},25,[743],{"type":50,"tag":222,"props":744,"children":745},{},[746],{"type":56,"value":747},"    return float(result)\n",{"type":50,"tag":65,"props":749,"children":751},{"id":750},"step-2-register-the-metric",[752],{"type":56,"value":753},"Step 2: Register the metric",{"type":50,"tag":211,"props":755,"children":757},{"className":213,"code":756,"language":215,"meta":216,"style":216},"from physicsnemo.cfd.postprocessing_tools.metric_registry import register_metric\n\nregister_metric(\"my_metric\", my_metric_fn, domain=\"surface\")  # or \"volume\" or None\n",[758],{"type":50,"tag":80,"props":759,"children":760},{"__ignoreMap":216},[761,769,776],{"type":50,"tag":222,"props":762,"children":763},{"class":224,"line":225},[764],{"type":50,"tag":222,"props":765,"children":766},{},[767],{"type":56,"value":768},"from physicsnemo.cfd.postprocessing_tools.metric_registry import register_metric\n",{"type":50,"tag":222,"props":770,"children":771},{"class":224,"line":259},[772],{"type":50,"tag":222,"props":773,"children":774},{"emptyLinePlaceholder":447},[775],{"type":56,"value":450},{"type":50,"tag":222,"props":777,"children":778},{"class":224,"line":268},[779],{"type":50,"tag":222,"props":780,"children":781},{},[782],{"type":56,"value":783},"register_metric(\"my_metric\", my_metric_fn, domain=\"surface\")  # or \"volume\" or None\n",{"type":50,"tag":72,"props":785,"children":786},{},[787,798,809,820],{"type":50,"tag":76,"props":788,"children":789},{},[790,796],{"type":50,"tag":80,"props":791,"children":793},{"className":792},[],[794],{"type":56,"value":795},"domain=\"surface\"",{"type":56,"value":797}," — only used when model's inference domain is surface",{"type":50,"tag":76,"props":799,"children":800},{},[801,807],{"type":50,"tag":80,"props":802,"children":804},{"className":803},[],[805],{"type":56,"value":806},"domain=\"volume\"",{"type":56,"value":808}," — only used for volume inference",{"type":50,"tag":76,"props":810,"children":811},{},[812,818],{"type":50,"tag":80,"props":813,"children":815},{"className":814},[],[816],{"type":56,"value":817},"domain=None",{"type":56,"value":819}," — domain-agnostic fallback",{"type":50,"tag":76,"props":821,"children":822},{},[823,825,831],{"type":56,"value":824},"Same name can be registered for both domains with different functions (like ",{"type":50,"tag":80,"props":826,"children":828},{"className":827},[],[829],{"type":56,"value":830},"l2_pressure",{"type":56,"value":832},")",{"type":50,"tag":65,"props":834,"children":836},{"id":835},"step-3-use-in-benchmark-config",[837],{"type":56,"value":838},"Step 3: Use in benchmark config",{"type":50,"tag":59,"props":840,"children":841},{},[842,844,850],{"type":56,"value":843},"Add the metric name to the ",{"type":50,"tag":80,"props":845,"children":847},{"className":846},[],[848],{"type":56,"value":849},"metrics",{"type":56,"value":851}," list:",{"type":50,"tag":211,"props":853,"children":855},{"className":213,"code":854,"language":215,"meta":216,"style":216},"config = Config.from_dict({\n    ...\n    \"metrics\": [\"l2_pressure\", \"drag\", \"lift\", \"my_metric\"],\n    ...\n})\n",[856],{"type":50,"tag":80,"props":857,"children":858},{"__ignoreMap":216},[859,867,874,882,889],{"type":50,"tag":222,"props":860,"children":861},{"class":224,"line":225},[862],{"type":50,"tag":222,"props":863,"children":864},{},[865],{"type":56,"value":866},"config = Config.from_dict({\n",{"type":50,"tag":222,"props":868,"children":869},{"class":224,"line":259},[870],{"type":50,"tag":222,"props":871,"children":872},{},[873],{"type":56,"value":346},{"type":50,"tag":222,"props":875,"children":876},{"class":224,"line":268},[877],{"type":50,"tag":222,"props":878,"children":879},{},[880],{"type":56,"value":881},"    \"metrics\": [\"l2_pressure\", \"drag\", \"lift\", \"my_metric\"],\n",{"type":50,"tag":222,"props":883,"children":884},{"class":224,"line":277},[885],{"type":50,"tag":222,"props":886,"children":887},{},[888],{"type":56,"value":346},{"type":50,"tag":222,"props":890,"children":891},{"class":224,"line":286},[892],{"type":50,"tag":222,"props":893,"children":894},{},[895],{"type":56,"value":896},"})\n",{"type":50,"tag":59,"props":898,"children":899},{},[900],{"type":56,"value":901},"Or in YAML:",{"type":50,"tag":211,"props":903,"children":907},{"className":904,"code":905,"language":906,"meta":216,"style":216},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","metrics:\n  - l2_pressure\n  - my_metric\n","yaml",[908],{"type":50,"tag":80,"props":909,"children":910},{"__ignoreMap":216},[911,925,939],{"type":50,"tag":222,"props":912,"children":913},{"class":224,"line":225},[914,919],{"type":50,"tag":222,"props":915,"children":917},{"style":916},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[918],{"type":56,"value":849},{"type":50,"tag":222,"props":920,"children":922},{"style":921},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[923],{"type":56,"value":924},":\n",{"type":50,"tag":222,"props":926,"children":927},{"class":224,"line":259},[928,933],{"type":50,"tag":222,"props":929,"children":930},{"style":921},[931],{"type":56,"value":932},"  -",{"type":50,"tag":222,"props":934,"children":936},{"style":935},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[937],{"type":56,"value":938}," l2_pressure\n",{"type":50,"tag":222,"props":940,"children":941},{"class":224,"line":268},[942,946],{"type":50,"tag":222,"props":943,"children":944},{"style":921},[945],{"type":56,"value":932},{"type":50,"tag":222,"props":947,"children":948},{"style":935},[949],{"type":56,"value":950}," my_metric\n",{"type":50,"tag":59,"props":952,"children":953},{},[954],{"type":56,"value":955},"Per-metric kwargs can be passed as a dict:",{"type":50,"tag":211,"props":957,"children":959},{"className":904,"code":958,"language":906,"meta":216,"style":216},"metrics:\n  - name: my_metric\n    some_param: 42\n",[960],{"type":50,"tag":80,"props":961,"children":962},{"__ignoreMap":216},[963,974,994],{"type":50,"tag":222,"props":964,"children":965},{"class":224,"line":225},[966,970],{"type":50,"tag":222,"props":967,"children":968},{"style":916},[969],{"type":56,"value":849},{"type":50,"tag":222,"props":971,"children":972},{"style":921},[973],{"type":56,"value":924},{"type":50,"tag":222,"props":975,"children":976},{"class":224,"line":259},[977,981,986,990],{"type":50,"tag":222,"props":978,"children":979},{"style":921},[980],{"type":56,"value":932},{"type":50,"tag":222,"props":982,"children":983},{"style":916},[984],{"type":56,"value":985}," name",{"type":50,"tag":222,"props":987,"children":988},{"style":921},[989],{"type":56,"value":356},{"type":50,"tag":222,"props":991,"children":992},{"style":935},[993],{"type":56,"value":950},{"type":50,"tag":222,"props":995,"children":996},{"class":224,"line":268},[997,1002,1006],{"type":50,"tag":222,"props":998,"children":999},{"style":916},[1000],{"type":56,"value":1001},"    some_param",{"type":50,"tag":222,"props":1003,"children":1004},{"style":921},[1005],{"type":56,"value":356},{"type":50,"tag":222,"props":1007,"children":1009},{"style":1008},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1010],{"type":56,"value":1011}," 42\n",{"type":50,"tag":65,"props":1013,"children":1015},{"id":1014},"step-4-make-permanent-optional",[1016],{"type":56,"value":1017},"Step 4: Make permanent (optional)",{"type":50,"tag":59,"props":1019,"children":1020},{},[1021,1023,1029,1031,1037],{"type":56,"value":1022},"Add to ",{"type":50,"tag":80,"props":1024,"children":1026},{"className":1025},[],[1027],{"type":56,"value":1028},"physicsnemo\u002Fcfd\u002Fevaluation\u002Fmetrics\u002Fbuiltin\u002F",{"type":56,"value":1030}," and register from ",{"type":50,"tag":80,"props":1032,"children":1034},{"className":1033},[],[1035],{"type":56,"value":1036},"builtin\u002F__init__.py",{"type":56,"value":356},{"type":50,"tag":211,"props":1039,"children":1041},{"className":213,"code":1040,"language":215,"meta":216,"style":216},"def register_my_metrics():\n    register_metric(\"my_metric\", my_fn, domain=\"surface\")\n\n# In __init__.py:\ndef register_all_builtin_metrics():\n    register_l2_metrics()\n    register_force_metrics()\n    register_physics_metrics()\n    register_my_metrics()  # add this\n",[1042],{"type":50,"tag":80,"props":1043,"children":1044},{"__ignoreMap":216},[1045,1053,1061,1068,1076,1084,1092,1100,1108],{"type":50,"tag":222,"props":1046,"children":1047},{"class":224,"line":225},[1048],{"type":50,"tag":222,"props":1049,"children":1050},{},[1051],{"type":56,"value":1052},"def register_my_metrics():\n",{"type":50,"tag":222,"props":1054,"children":1055},{"class":224,"line":259},[1056],{"type":50,"tag":222,"props":1057,"children":1058},{},[1059],{"type":56,"value":1060},"    register_metric(\"my_metric\", my_fn, domain=\"surface\")\n",{"type":50,"tag":222,"props":1062,"children":1063},{"class":224,"line":268},[1064],{"type":50,"tag":222,"props":1065,"children":1066},{"emptyLinePlaceholder":447},[1067],{"type":56,"value":450},{"type":50,"tag":222,"props":1069,"children":1070},{"class":224,"line":277},[1071],{"type":50,"tag":222,"props":1072,"children":1073},{},[1074],{"type":56,"value":1075},"# In __init__.py:\n",{"type":50,"tag":222,"props":1077,"children":1078},{"class":224,"line":286},[1079],{"type":50,"tag":222,"props":1080,"children":1081},{},[1082],{"type":56,"value":1083},"def register_all_builtin_metrics():\n",{"type":50,"tag":222,"props":1085,"children":1086},{"class":224,"line":295},[1087],{"type":50,"tag":222,"props":1088,"children":1089},{},[1090],{"type":56,"value":1091},"    register_l2_metrics()\n",{"type":50,"tag":222,"props":1093,"children":1094},{"class":224,"line":304},[1095],{"type":50,"tag":222,"props":1096,"children":1097},{},[1098],{"type":56,"value":1099},"    register_force_metrics()\n",{"type":50,"tag":222,"props":1101,"children":1102},{"class":224,"line":313},[1103],{"type":50,"tag":222,"props":1104,"children":1105},{},[1106],{"type":56,"value":1107},"    register_physics_metrics()\n",{"type":50,"tag":222,"props":1109,"children":1110},{"class":224,"line":322},[1111],{"type":50,"tag":222,"props":1112,"children":1113},{},[1114],{"type":56,"value":1115},"    register_my_metrics()  # add this\n",{"type":50,"tag":65,"props":1117,"children":1119},{"id":1118},"existing-built-in-metrics",[1120],{"type":56,"value":1121},"Existing built-in metrics",{"type":50,"tag":1123,"props":1124,"children":1125},"table",{},[1126,1150],{"type":50,"tag":1127,"props":1128,"children":1129},"thead",{},[1130],{"type":50,"tag":1131,"props":1132,"children":1133},"tr",{},[1134,1140,1145],{"type":50,"tag":1135,"props":1136,"children":1137},"th",{},[1138],{"type":56,"value":1139},"Name",{"type":50,"tag":1135,"props":1141,"children":1142},{},[1143],{"type":56,"value":1144},"Domain(s)",{"type":50,"tag":1135,"props":1146,"children":1147},{},[1148],{"type":56,"value":1149},"Returns",{"type":50,"tag":1151,"props":1152,"children":1153},"tbody",{},[1154,1179,1205,1229,1254,1278,1304,1329,1353],{"type":50,"tag":1131,"props":1155,"children":1156},{},[1157,1166,1171],{"type":50,"tag":1158,"props":1159,"children":1160},"td",{},[1161],{"type":50,"tag":80,"props":1162,"children":1164},{"className":1163},[],[1165],{"type":56,"value":830},{"type":50,"tag":1158,"props":1167,"children":1168},{},[1169],{"type":56,"value":1170},"surface, volume",{"type":50,"tag":1158,"props":1172,"children":1173},{},[1174],{"type":50,"tag":80,"props":1175,"children":1177},{"className":1176},[],[1178],{"type":56,"value":368},{"type":50,"tag":1131,"props":1180,"children":1181},{},[1182,1191,1196],{"type":50,"tag":1158,"props":1183,"children":1184},{},[1185],{"type":50,"tag":80,"props":1186,"children":1188},{"className":1187},[],[1189],{"type":56,"value":1190},"l2_shear_stress",{"type":50,"tag":1158,"props":1192,"children":1193},{},[1194],{"type":56,"value":1195},"surface",{"type":50,"tag":1158,"props":1197,"children":1198},{},[1199],{"type":50,"tag":80,"props":1200,"children":1202},{"className":1201},[],[1203],{"type":56,"value":1204},"dict",{"type":50,"tag":1131,"props":1206,"children":1207},{},[1208,1217,1221],{"type":50,"tag":1158,"props":1209,"children":1210},{},[1211],{"type":50,"tag":80,"props":1212,"children":1214},{"className":1213},[],[1215],{"type":56,"value":1216},"l2_pressure_area_weighted",{"type":50,"tag":1158,"props":1218,"children":1219},{},[1220],{"type":56,"value":1195},{"type":50,"tag":1158,"props":1222,"children":1223},{},[1224],{"type":50,"tag":80,"props":1225,"children":1227},{"className":1226},[],[1228],{"type":56,"value":368},{"type":50,"tag":1131,"props":1230,"children":1231},{},[1232,1241,1246],{"type":50,"tag":1158,"props":1233,"children":1234},{},[1235],{"type":50,"tag":80,"props":1236,"children":1238},{"className":1237},[],[1239],{"type":56,"value":1240},"l2_velocity",{"type":50,"tag":1158,"props":1242,"children":1243},{},[1244],{"type":56,"value":1245},"volume",{"type":50,"tag":1158,"props":1247,"children":1248},{},[1249],{"type":50,"tag":80,"props":1250,"children":1252},{"className":1251},[],[1253],{"type":56,"value":1204},{"type":50,"tag":1131,"props":1255,"children":1256},{},[1257,1266,1270],{"type":50,"tag":1158,"props":1258,"children":1259},{},[1260],{"type":50,"tag":80,"props":1261,"children":1263},{"className":1262},[],[1264],{"type":56,"value":1265},"l2_turbulent_viscosity",{"type":50,"tag":1158,"props":1267,"children":1268},{},[1269],{"type":56,"value":1245},{"type":50,"tag":1158,"props":1271,"children":1272},{},[1273],{"type":50,"tag":80,"props":1274,"children":1276},{"className":1275},[],[1277],{"type":56,"value":368},{"type":50,"tag":1131,"props":1279,"children":1280},{},[1281,1290,1294],{"type":50,"tag":1158,"props":1282,"children":1283},{},[1284],{"type":50,"tag":80,"props":1285,"children":1287},{"className":1286},[],[1288],{"type":56,"value":1289},"drag",{"type":50,"tag":1158,"props":1291,"children":1292},{},[1293],{"type":56,"value":1195},{"type":50,"tag":1158,"props":1295,"children":1296},{},[1297,1302],{"type":50,"tag":80,"props":1298,"children":1300},{"className":1299},[],[1301],{"type":56,"value":1204},{"type":56,"value":1303}," (error, true, pred)",{"type":50,"tag":1131,"props":1305,"children":1306},{},[1307,1316,1320],{"type":50,"tag":1158,"props":1308,"children":1309},{},[1310],{"type":50,"tag":80,"props":1311,"children":1313},{"className":1312},[],[1314],{"type":56,"value":1315},"lift",{"type":50,"tag":1158,"props":1317,"children":1318},{},[1319],{"type":56,"value":1195},{"type":50,"tag":1158,"props":1321,"children":1322},{},[1323,1328],{"type":50,"tag":80,"props":1324,"children":1326},{"className":1325},[],[1327],{"type":56,"value":1204},{"type":56,"value":1303},{"type":50,"tag":1131,"props":1330,"children":1331},{},[1332,1341,1345],{"type":50,"tag":1158,"props":1333,"children":1334},{},[1335],{"type":50,"tag":80,"props":1336,"children":1338},{"className":1337},[],[1339],{"type":56,"value":1340},"continuity_residual_l2",{"type":50,"tag":1158,"props":1342,"children":1343},{},[1344],{"type":56,"value":1245},{"type":50,"tag":1158,"props":1346,"children":1347},{},[1348],{"type":50,"tag":80,"props":1349,"children":1351},{"className":1350},[],[1352],{"type":56,"value":368},{"type":50,"tag":1131,"props":1354,"children":1355},{},[1356,1365,1369],{"type":50,"tag":1158,"props":1357,"children":1358},{},[1359],{"type":50,"tag":80,"props":1360,"children":1362},{"className":1361},[],[1363],{"type":56,"value":1364},"momentum_residual_l2",{"type":50,"tag":1158,"props":1366,"children":1367},{},[1368],{"type":56,"value":1245},{"type":50,"tag":1158,"props":1370,"children":1371},{},[1372],{"type":50,"tag":80,"props":1373,"children":1375},{"className":1374},[],[1376],{"type":56,"value":368},{"type":50,"tag":65,"props":1378,"children":1380},{"id":1379},"gotchas",[1381],{"type":56,"value":1382},"Gotchas",{"type":50,"tag":72,"props":1384,"children":1385},{},[1386,1435,1453,1487,1520],{"type":50,"tag":76,"props":1387,"children":1388},{},[1389,1394,1396,1402,1404,1410,1411,1417,1419,1425,1427,1433],{"type":50,"tag":235,"props":1390,"children":1391},{},[1392],{"type":56,"value":1393},"Dict flattening",{"type":56,"value":1395},": if metric returns ",{"type":50,"tag":80,"props":1397,"children":1399},{"className":1398},[],[1400],{"type":56,"value":1401},"{\"error\": 0.1, \"true\": 5.0}",{"type":56,"value":1403},",\nengine stores as ",{"type":50,"tag":80,"props":1405,"children":1407},{"className":1406},[],[1408],{"type":56,"value":1409},"metricname_error",{"type":56,"value":405},{"type":50,"tag":80,"props":1412,"children":1414},{"className":1413},[],[1415],{"type":56,"value":1416},"metricname_true",{"type":56,"value":1418},". An empty\nstring key ",{"type":50,"tag":80,"props":1420,"children":1422},{"className":1421},[],[1423],{"type":56,"value":1424},"\"\"",{"type":56,"value":1426}," maps to just ",{"type":50,"tag":80,"props":1428,"children":1430},{"className":1429},[],[1431],{"type":56,"value":1432},"metricname",{"type":56,"value":1434},".",{"type":50,"tag":76,"props":1436,"children":1437},{},[1438,1443,1445,1451],{"type":50,"tag":235,"props":1439,"children":1440},{},[1441],{"type":56,"value":1442},"NaN handling",{"type":56,"value":1444},": return ",{"type":50,"tag":80,"props":1446,"children":1448},{"className":1447},[],[1449],{"type":56,"value":1450},"float(\"nan\")",{"type":56,"value":1452}," for failures; engine\naccumulates NaN gracefully.",{"type":50,"tag":76,"props":1454,"children":1455},{},[1456,1461,1463,1469,1471,1477,1479,1485],{"type":50,"tag":235,"props":1457,"children":1458},{},[1459],{"type":56,"value":1460},"Legacy fallback",{"type":56,"value":1462},": engine tries extended kwargs first; on\n",{"type":50,"tag":80,"props":1464,"children":1466},{"className":1465},[],[1467],{"type":56,"value":1468},"TypeError",{"type":56,"value":1470}," it falls back to ",{"type":50,"tag":80,"props":1472,"children":1474},{"className":1473},[],[1475],{"type":56,"value":1476},"fn(gt, predictions, **mkwargs)",{"type":56,"value":1478}," only.\nModern metrics should accept ",{"type":50,"tag":80,"props":1480,"children":1482},{"className":1481},[],[1483],{"type":56,"value":1484},"**_",{"type":56,"value":1486}," to absorb unknowns.",{"type":50,"tag":76,"props":1488,"children":1489},{},[1490,1495,1497,1503,1505,1511,1513,1519],{"type":50,"tag":235,"props":1491,"children":1492},{},[1493],{"type":56,"value":1494},"Results JSON format",{"type":56,"value":1496},": ",{"type":50,"tag":80,"props":1498,"children":1500},{"className":1499},[],[1501],{"type":56,"value":1502},"benchmark_results.json",{"type":56,"value":1504}," is a plain\n",{"type":50,"tag":80,"props":1506,"children":1508},{"className":1507},[],[1509],{"type":56,"value":1510},"list[dict]",{"type":56,"value":1512},", not ",{"type":50,"tag":80,"props":1514,"children":1516},{"className":1515},[],[1517],{"type":56,"value":1518},"{\"results\": [...]}",{"type":56,"value":1434},{"type":50,"tag":76,"props":1521,"children":1522},{},[1523,1528,1530,1536,1538,1544,1546,1552,1553,1559],{"type":50,"tag":235,"props":1524,"children":1525},{},[1526],{"type":56,"value":1527},"OutputConfig field names",{"type":56,"value":1529},": surface uses ",{"type":50,"tag":80,"props":1531,"children":1533},{"className":1532},[],[1534],{"type":56,"value":1535},"output.mesh_field_names",{"type":56,"value":1537}," \u002F\n",{"type":50,"tag":80,"props":1539,"children":1541},{"className":1540},[],[1542],{"type":56,"value":1543},"output.ground_truth_mesh_field_names",{"type":56,"value":1545},"; volume uses\n",{"type":50,"tag":80,"props":1547,"children":1549},{"className":1548},[],[1550],{"type":56,"value":1551},"output.volume_mesh_field_names",{"type":56,"value":1537},{"type":50,"tag":80,"props":1554,"children":1556},{"className":1555},[],[1557],{"type":56,"value":1558},"output.ground_truth_volume_mesh_field_names",{"type":56,"value":1434},{"type":50,"tag":1561,"props":1562,"children":1563},"style",{},[1564],{"type":56,"value":1565},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1567,"total":1725},[1568,1586,1603,1614,1626,1640,1653,1667,1680,1691,1705,1714],{"slug":1569,"name":1569,"fn":1570,"description":1571,"org":1572,"tags":1573,"stars":1583,"repoUrl":1584,"updatedAt":1585},"nemoclaw-user-guide","retrieve NemoClaw documentation and configuration","Guides human users' AI agents to the NemoClaw docs MCP server and canonical Fern documentation in Markdown form. Use when users ask how to install, configure, operate, troubleshoot, secure, or learn NemoClaw with an AI coding assistant. Trigger keywords - nemoclaw docs, use nemoclaw with ai agent, nemoclaw mcp docs, nemoclaw install help, nemoclaw quickstart, nemoclaw markdown docs, llms.txt, agent skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1574,1577,1580],{"name":1575,"slug":1576,"type":15},"Documentation","documentation",{"name":1578,"slug":1579,"type":15},"MCP","mcp",{"name":1581,"slug":1582,"type":15},"Search","search",21777,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNemoClaw","2026-07-20T06:00:01.461044",{"slug":1587,"name":1587,"fn":1588,"description":1589,"org":1590,"tags":1591,"stars":1600,"repoUrl":1601,"updatedAt":1602},"mcore-build-and-dependency","manage Megatron-LM development environments","Container-based dev environment setup and dependency management for Megatron-LM. Covers acquiring and launching the CI container, uv package management, and updating uv.lock.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1592,1595,1598],{"name":1593,"slug":1594,"type":15},"Containers","containers",{"name":1596,"slug":1597,"type":15},"Deployment","deployment",{"name":1599,"slug":215,"type":15},"Python",17049,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FMegatron-LM","2026-07-27T06:06:11.249662",{"slug":1604,"name":1604,"fn":1605,"description":1606,"org":1607,"tags":1608,"stars":1600,"repoUrl":1601,"updatedAt":1613},"mcore-bump-base-image","update NVIDIA PyTorch base images","Bump the NVIDIA PyTorch base image (`nvcr.io\u002Fnvidia\u002Fpytorch:YY.MM-py3`) used by Megatron-LM CI. Covers the two pin sites (GitHub CI in `docker\u002F.ngc_version.dev` and GitLab CI in `.gitlab\u002Fstages\u002F01.build.yml`), the post-bump CI loop (re-run functional tests, refresh golden values, mark broken tests), and the gotchas that bit PRs",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1609,1612],{"name":1610,"slug":1611,"type":15},"CI\u002FCD","ci-cd",{"name":1596,"slug":1597,"type":15},"2026-07-14T05:25:59.97109",{"slug":1615,"name":1615,"fn":1616,"description":1617,"org":1618,"tags":1619,"stars":1600,"repoUrl":1601,"updatedAt":1625},"mcore-cicd","manage CI\u002FCD pipelines for Megatron-LM","CI\u002FCD reference for Megatron-LM. Covers CI pipeline structure, PR scope labels, triggering internal GitLab CI (which force-pushes the current branch to a pull-request\u002FBRANCH ref — always dry-run and verify the destination first; never run against shared or protected branches), and CI failure investigation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1620,1621,1622],{"name":1610,"slug":1611,"type":15},{"name":1596,"slug":1597,"type":15},{"name":1623,"slug":1624,"type":15},"GitHub","github","2026-07-27T06:06:12.278222",{"slug":1627,"name":1627,"fn":1628,"description":1629,"org":1630,"tags":1631,"stars":1600,"repoUrl":1601,"updatedAt":1639},"mcore-create-issue","investigate CI failures and create issues","Investigate a failing GitHub Actions run or job and create a GitHub issue for the failure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1632,1635,1636],{"name":1633,"slug":1634,"type":15},"Debugging","debugging",{"name":1623,"slug":1624,"type":15},{"name":1637,"slug":1638,"type":15},"Triage","triage","2026-07-14T05:25:57.442089",{"slug":1641,"name":1641,"fn":1642,"description":1643,"org":1644,"tags":1645,"stars":1600,"repoUrl":1601,"updatedAt":1652},"mcore-linting-and-formatting","lint and format Megatron-LM code","Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1646,1649],{"name":1647,"slug":1648,"type":15},"Best Practices","best-practices",{"name":1650,"slug":1651,"type":15},"Code Analysis","code-analysis","2026-07-14T05:25:56.18433",{"slug":1654,"name":1654,"fn":1655,"description":1656,"org":1657,"tags":1658,"stars":1600,"repoUrl":1601,"updatedAt":1666},"mcore-migrate-gpt-to-hybrid","migrate Megatron-LM models to HybridModel","Migration guide for moving Megatron Core GPTModel checkpoints, model providers, training commands, and layer mappings to HybridModel.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1659,1662,1665],{"name":1660,"slug":1661,"type":15},"Machine Learning","machine-learning",{"name":1663,"slug":1664,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-17T06:07:11.777011",{"slug":1668,"name":1668,"fn":1669,"description":1670,"org":1671,"tags":1672,"stars":1600,"repoUrl":1601,"updatedAt":1679},"mcore-onboard-gb200-1node-tests","onboard functional tests for GB200","Onboard 1-node GitHub MR functional tests for GB200 from existing mr-scoped 2-node tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1673,1676],{"name":1674,"slug":1675,"type":15},"QA","qa",{"name":1677,"slug":1678,"type":15},"Testing","testing","2026-07-14T05:25:53.673039",{"slug":1681,"name":1681,"fn":1682,"description":1683,"org":1684,"tags":1685,"stars":1600,"repoUrl":1601,"updatedAt":1690},"mcore-run-on-slurm","launch distributed training jobs on SLURM","How to launch distributed Megatron-LM training jobs on a SLURM cluster. Covers a minimal sbatch skeleton, environment-variable setup for torch.distributed.run, CUDA_DEVICE_MAX_CONNECTIONS rules across hardware and parallelism modes, container conventions, monitoring, and per-rank failure diagnosis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1686,1687],{"name":1596,"slug":1597,"type":15},{"name":1688,"slug":1689,"type":15},"Infrastructure","infrastructure","2026-07-14T05:25:49.362534",{"slug":1692,"name":1692,"fn":1693,"description":1694,"org":1695,"tags":1696,"stars":1600,"repoUrl":1601,"updatedAt":1704},"mcore-split-pr","split pull requests to reduce review load","Split a PR into multiple PRs to reduce the number of required CODEOWNERS reviewer groups.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1697,1700,1701],{"name":1698,"slug":1699,"type":15},"Code Review","code-review",{"name":1623,"slug":1624,"type":15},{"name":1702,"slug":1703,"type":15},"Pull Requests","pull-requests","2026-07-14T05:26:01.226578",{"slug":1706,"name":1706,"fn":1707,"description":1708,"org":1709,"tags":1710,"stars":1600,"repoUrl":1601,"updatedAt":1713},"mcore-testing","run and manage Megatron-LM tests","Test system for Megatron-LM. Covers test layout, recipe YAML structure, adding and running unit and functional tests, golden values, marker filters, and CI parity.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1711,1712],{"name":1674,"slug":1675,"type":15},{"name":1677,"slug":1678,"type":15},"2026-07-14T05:25:54.928983",{"slug":1715,"name":1715,"fn":1716,"description":1717,"org":1718,"tags":1719,"stars":1600,"repoUrl":1601,"updatedAt":1724},"nightly-sync","manage nightly main-to-dev sync workflows","Domain knowledge for the nightly main-to-dev sync workflow. Covers merge strategy, CI architecture, failure investigation, and known issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1720,1723],{"name":1721,"slug":1722,"type":15},"Automation","automation",{"name":1610,"slug":1611,"type":15},"2026-07-30T05:29:03.275638",496,{"items":1727,"total":268},[1728,1736,1750],{"slug":4,"name":4,"fn":5,"description":6,"org":1729,"tags":1730,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1731,1732,1733,1734,1735],{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":24,"slug":25,"type":15},{"name":21,"slug":22,"type":15},{"slug":1737,"name":1737,"fn":1738,"description":1739,"org":1740,"tags":1741,"stars":26,"repoUrl":27,"updatedAt":1749},"physicsnemo-cfd-create-dataset-adapter","create dataset adapters for CFD benchmarking","Create a new dataset adapter for the PhysicsNeMo CFD benchmarking workflow. Use when the user wants to add a new CFD dataset, write a DatasetAdapter, integrate a new mesh format, or benchmark models on custom data.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1742,1743,1746,1747,1748],{"name":13,"slug":14,"type":15},{"name":1744,"slug":1745,"type":15},"Datasets","datasets",{"name":9,"slug":8,"type":15},{"name":24,"slug":25,"type":15},{"name":21,"slug":22,"type":15},"2026-07-14T05:33:35.569433",{"slug":1751,"name":1751,"fn":1752,"description":1753,"org":1754,"tags":1755,"stars":26,"repoUrl":27,"updatedAt":1763},"physicsnemo-cfd-create-model-wrapper","create model wrappers for CFD benchmarking","Create a new model wrapper for the PhysicsNeMo CFD benchmarking workflow. Use when the user wants to add a new CFD model, write a CFDModel wrapper, integrate a new neural network architecture, or run a custom model through the benchmarking pipeline.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1756,1757,1760,1761,1762],{"name":13,"slug":14,"type":15},{"name":1758,"slug":1759,"type":15},"Deep Learning","deep-learning",{"name":9,"slug":8,"type":15},{"name":24,"slug":25,"type":15},{"name":21,"slug":22,"type":15},"2026-07-14T05:33:33.080019"]