{
  "schemaVersion": 1,
  "id": "residual-classifier",
  "name": "ResidualClassifier",
  "provenance": {
    "capturedAt": "2026-09-16T20:05:17.493431+00:00",
    "productRevision": "cf0ab1c9c58c1dc640235b742fa032cade00b43c",
    "python": "3.13.13",
    "torch": "2.7.1",
    "execution": {
      "inputs": {
        "args": [
          {
            "shape": [
              1,
              64
            ],
            "dtype": "float32",
            "fill": "ones"
          }
        ]
      },
      "device": "cpu",
      "mode": "eval",
      "seed": 0,
      "deterministic": true
    },
    "captureMethod": "TensorViz multifile projection API and isolated execution worker",
    "installedJourneyVerified": true,
    "scope": "One explicit CPU forward per version with the recorded input and seed.",
    "versions": {
      "before": {
        "sourceSha256": "1a1a31d429f0dbebce14e2d2ff1c922cf3dbe3139beb88a132da18fb1445565e",
        "workerExitCode": 4,
        "outcome": "failed"
      },
      "after": {
        "sourceSha256": "51202cd1fd0195075233c3ba6ecc45c6d065e0d3da33a3f87b78d7f39de4b135",
        "workerExitCode": 0,
        "outcome": "passed"
      }
    },
    "installedAfterVerificationUrl": "/examples/installed-after-verification.json",
    "installedJourneyScope": "Separate installed sessions: exact-input A through Codex CLI; native Apply/Discard/Undo/Save; exact-input B through the official MCP SDK. Native footage remains incomplete."
  },
  "versions": {
    "before": {
      "id": "before",
      "label": "Version A",
      "source": {
        "url": "/examples/residual-before.py",
        "sha256": "1a1a31d429f0dbebce14e2d2ff1c922cf3dbe3139beb88a132da18fb1445565e",
        "text": "\"\"\"TensorViz public example: a residual classifier with a 128-feature block.\"\"\"\nimport torch.nn as nn\n\n\nclass ResidualBlock(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.expand = nn.Linear(128, 256)\n        self.relu = nn.ReLU()\n        self.project = nn.Linear(256, 128)\n\n    def forward(self, x):\n        residual = x\n        x = self.expand(x)\n        x = self.relu(x)\n        x = self.project(x)\n        return x + residual\n\n\n# tensorviz: input=1,64\nclass ResidualClassifier(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.stem = nn.Linear(64, 128)\n        self.block = ResidualBlock()\n        self.head = nn.Linear(64, 10)\n\n    def forward(self, x):\n        x = self.stem(x)\n        x = self.block(x)\n        return self.head(x)\n"
      },
      "graphUrl": "/examples/residual-before.tensorviz.json",
      "evidenceUrl": "/examples/evidence-before.json",
      "evidenceId": "residual-before-1a1a31d429f0",
      "outcome": "failed",
      "failure": {
        "message": "RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x128 and 64x10)",
        "nodeId": "head",
        "file": "residual-before.py",
        "line": 31
      },
      "nodes": [
        {
          "id": "input",
          "kind": "input",
          "label": "Input",
          "op": "Input",
          "params": {
            "shape": "1,64"
          },
          "parent": null,
          "source": null,
          "observation": {
            "status": "completed",
            "inputs": [],
            "outputs": [
              {
                "shape": [
                  1,
                  64
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "stem",
          "kind": "layer",
          "label": "Stem",
          "op": "Linear",
          "params": {
            "in_features": 64,
            "out_features": 128
          },
          "parent": null,
          "source": {
            "file": "residual-before.py",
            "line": 24,
            "endLine": 24,
            "excerpt": "self.stem = nn.Linear(64, 128)"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  64
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "block",
          "kind": "module",
          "label": "ResidualBlock",
          "op": "Module",
          "params": {},
          "parent": null,
          "source": {
            "file": "residual-before.py",
            "line": 25,
            "endLine": 25,
            "excerpt": "self.block = ResidualBlock()"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "head",
          "kind": "layer",
          "label": "Head",
          "op": "Linear",
          "params": {
            "in_features": 64,
            "out_features": 10
          },
          "parent": null,
          "source": {
            "file": "residual-before.py",
            "line": 26,
            "endLine": 26,
            "excerpt": "self.head = nn.Linear(64, 10)"
          },
          "observation": {
            "status": "failed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": []
          }
        },
        {
          "id": "output",
          "kind": "output",
          "label": "Output",
          "op": "Output",
          "params": {},
          "parent": null,
          "source": null,
          "observation": {
            "status": "unreached",
            "inputs": [],
            "outputs": []
          }
        },
        {
          "id": "block.expand",
          "kind": "layer",
          "label": "Expand",
          "op": "Linear",
          "params": {
            "in_features": 128,
            "out_features": 256
          },
          "parent": "block",
          "source": {
            "file": "residual-before.py",
            "line": 8,
            "endLine": 8,
            "excerpt": "self.expand = nn.Linear(128, 256)"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "block.relu",
          "kind": "layer",
          "label": "ReLU",
          "op": "ReLU",
          "params": {},
          "parent": "block",
          "source": {
            "file": "residual-before.py",
            "line": 9,
            "endLine": 9,
            "excerpt": "self.relu = nn.ReLU()"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "block.project",
          "kind": "layer",
          "label": "Project",
          "op": "Linear",
          "params": {
            "in_features": 256,
            "out_features": 128
          },
          "parent": "block",
          "source": {
            "file": "residual-before.py",
            "line": 10,
            "endLine": 10,
            "excerpt": "self.project = nn.Linear(256, 128)"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "add@block#0",
          "kind": "layer",
          "label": "Add",
          "op": "torch.add",
          "params": {},
          "parent": "block",
          "source": {
            "file": "residual-before.py",
            "line": 17,
            "endLine": 17,
            "excerpt": "return x + residual"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              },
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        }
      ],
      "edges": [
        {
          "id": "edge-1",
          "source": "block.expand",
          "target": "block.relu"
        },
        {
          "id": "edge-2",
          "source": "block.relu",
          "target": "block.project"
        },
        {
          "id": "edge-3",
          "source": "block.project",
          "target": "add@block#0"
        },
        {
          "id": "edge-4",
          "source": "input",
          "target": "stem"
        },
        {
          "id": "edge-5",
          "source": "stem",
          "target": "block.expand"
        },
        {
          "id": "edge-6",
          "source": "stem",
          "target": "add@block#0"
        },
        {
          "id": "edge-7",
          "source": "stem",
          "target": "block"
        },
        {
          "id": "edge-8",
          "source": "add@block#0",
          "target": "head"
        },
        {
          "id": "edge-9",
          "source": "block",
          "target": "head"
        },
        {
          "id": "edge-10",
          "source": "head",
          "target": "output"
        }
      ]
    },
    "after": {
      "id": "after",
      "label": "Version B",
      "source": {
        "url": "/examples/residual-after.py",
        "sha256": "51202cd1fd0195075233c3ba6ecc45c6d065e0d3da33a3f87b78d7f39de4b135",
        "text": "\"\"\"TensorViz public example: a residual classifier with a 128-feature block.\"\"\"\nimport torch.nn as nn\n\n\nclass ResidualBlock(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.expand = nn.Linear(128, 256)\n        self.relu = nn.ReLU()\n        self.project = nn.Linear(256, 128)\n\n    def forward(self, x):\n        residual = x\n        x = self.expand(x)\n        x = self.relu(x)\n        x = self.project(x)\n        return x + residual\n\n\n# tensorviz: input=1,64\nclass ResidualClassifier(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.stem = nn.Linear(64, 128)\n        self.block = ResidualBlock()\n        self.head = nn.Linear(128, 10)\n\n    def forward(self, x):\n        x = self.stem(x)\n        x = self.block(x)\n        return self.head(x)\n"
      },
      "graphUrl": "/examples/residual-after.tensorviz.json",
      "evidenceUrl": "/examples/evidence-after.json",
      "evidenceId": "residual-after-51202cd1fd01",
      "outcome": "passed",
      "failure": null,
      "nodes": [
        {
          "id": "input",
          "kind": "input",
          "label": "Input",
          "op": "Input",
          "params": {
            "shape": "1,64"
          },
          "parent": null,
          "source": null,
          "observation": {
            "status": "completed",
            "inputs": [],
            "outputs": [
              {
                "shape": [
                  1,
                  64
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "stem",
          "kind": "layer",
          "label": "Stem",
          "op": "Linear",
          "params": {
            "in_features": 64,
            "out_features": 128
          },
          "parent": null,
          "source": {
            "file": "residual-after.py",
            "line": 24,
            "endLine": 24,
            "excerpt": "self.stem = nn.Linear(64, 128)"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  64
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "block",
          "kind": "module",
          "label": "ResidualBlock",
          "op": "Module",
          "params": {},
          "parent": null,
          "source": {
            "file": "residual-after.py",
            "line": 25,
            "endLine": 25,
            "excerpt": "self.block = ResidualBlock()"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "head",
          "kind": "layer",
          "label": "Head",
          "op": "Linear",
          "params": {
            "in_features": 128,
            "out_features": 10
          },
          "parent": null,
          "source": {
            "file": "residual-after.py",
            "line": 26,
            "endLine": 26,
            "excerpt": "self.head = nn.Linear(128, 10)"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  10
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "output",
          "kind": "output",
          "label": "Output",
          "op": "Output",
          "params": {},
          "parent": null,
          "source": null,
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  10
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  10
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "block.expand",
          "kind": "layer",
          "label": "Expand",
          "op": "Linear",
          "params": {
            "in_features": 128,
            "out_features": 256
          },
          "parent": "block",
          "source": {
            "file": "residual-after.py",
            "line": 8,
            "endLine": 8,
            "excerpt": "self.expand = nn.Linear(128, 256)"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "block.relu",
          "kind": "layer",
          "label": "ReLU",
          "op": "ReLU",
          "params": {},
          "parent": "block",
          "source": {
            "file": "residual-after.py",
            "line": 9,
            "endLine": 9,
            "excerpt": "self.relu = nn.ReLU()"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "block.project",
          "kind": "layer",
          "label": "Project",
          "op": "Linear",
          "params": {
            "in_features": 256,
            "out_features": 128
          },
          "parent": "block",
          "source": {
            "file": "residual-after.py",
            "line": 10,
            "endLine": 10,
            "excerpt": "self.project = nn.Linear(256, 128)"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  256
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        },
        {
          "id": "add@block#0",
          "kind": "layer",
          "label": "Add",
          "op": "torch.add",
          "params": {},
          "parent": "block",
          "source": {
            "file": "residual-after.py",
            "line": 17,
            "endLine": 17,
            "excerpt": "return x + residual"
          },
          "observation": {
            "status": "completed",
            "inputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              },
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ],
            "outputs": [
              {
                "shape": [
                  1,
                  128
                ],
                "dtype": "torch.float32",
                "device": "cpu"
              }
            ]
          }
        }
      ],
      "edges": [
        {
          "id": "edge-1",
          "source": "block.expand",
          "target": "block.relu"
        },
        {
          "id": "edge-2",
          "source": "block.relu",
          "target": "block.project"
        },
        {
          "id": "edge-3",
          "source": "block.project",
          "target": "add@block#0"
        },
        {
          "id": "edge-4",
          "source": "input",
          "target": "stem"
        },
        {
          "id": "edge-5",
          "source": "stem",
          "target": "block.expand"
        },
        {
          "id": "edge-6",
          "source": "stem",
          "target": "add@block#0"
        },
        {
          "id": "edge-7",
          "source": "stem",
          "target": "block"
        },
        {
          "id": "edge-8",
          "source": "add@block#0",
          "target": "head"
        },
        {
          "id": "edge-9",
          "source": "block",
          "target": "head"
        },
        {
          "id": "edge-10",
          "source": "head",
          "target": "output"
        }
      ]
    }
  },
  "comparison": {
    "addedLayers": [],
    "removedLayers": [],
    "changedLayers": [
      {
        "nodeId": "head",
        "changes": [
          {
            "field": "parameters.in_features",
            "before": {
              "present": true,
              "value": 64
            },
            "after": {
              "present": true,
              "value": 128
            }
          }
        ]
      }
    ],
    "addedConnections": [],
    "removedConnections": [],
    "recordedShapes": [],
    "uncertainMatches": [],
    "modelNamesDiffer": false,
    "snapshotEvidenceChanged": false,
    "architectureChanged": true
  },
  "media": {}
}
