> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# nemo_gym.task_materialization

Wrap flat dataset rows with environment-neutral task identity.

## Module Contents

### Functions

| Name                                                                  | Description                                                                      |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [`materialize_task`](#nemo_gym-task_materialization-materialize_task) | Preserve legacy task identity and task fields without embedding runtime routing. |

### API

```python
nemo_gym.task_materialization.materialize_task(
    row: collections.abc.Mapping[str, pydantic.JsonValue],
    taskset: str,
    task_index: int | None = None
) -> dict[str, pydantic.JsonValue]
```

Preserve legacy task identity and task fields without embedding runtime routing.

Rows without an explicit ID use the collector's `_ng_task_index`, or a source-row
index across all datasets of the same type in the collation, before repeats.
Adding or reordering other datasets shifts these positional IDs; editing prompt text does not.
Prepared source files are never modified by this conversion.