Back to Research Index
Verification Suite•
2024-10-14
•Author: Swasthik Shetty•Status: ACTIVE

Milestone 1: Multi-Layer Perceptron (MLP) Parity Gate

Verification of exact step-by-step mathematical convergence against PyTorch 2.4

Milestone 1: Multi-Layer Perceptron (MLP) Parity Gate

Verification Suite 2024-10-14 Authors: Swasthik Shetty

Abstract: This report documents the verification protocol and empirical findings of the Milestone 1 parity gate. Using identical synthetic Gaussian batches and matched Kaiming initialization seeds, Dark Forest and PyTorch were executed through 200 optimization iterations using both SGD with momentum and AdamW.

Key Finding: Maximum cumulative loss difference across 200 training steps was strictly bounded at 2.38e-7 for AdamW and 1.14e-7 for SGD, proving mathematical equivalence.

Verification Methodology

To verify eager-mode correctness without heuristic assumptions, we designed an automated side-by-side test harness:

  1. Synthetic Data Harness: 1,000 samples generated from Gaussian distribution N(0, 1) with fixed seed.
  2. Double Precision Reference: PyTorch forward and backward passes executed with identical initialized weight tensors.
  3. Weight Transfer: Model weights extracted directly via DLPack memory capsules into Dark Forest Tensor structures.
  4. 200 Iteration Loop: At each step $t \in [1, 200]$, forward loss, backward gradients, and optimizer parameter updates were compared element-by-element.

Results Table

Step Interval PyTorch Loss Dark Forest Loss Absolute Difference Relative Delta
Step 1 2.418290 2.418290 0.000000 0.00%
Step 50 1.109482 1.109482 1.19e-7 0.00001%
Step 100 0.642194 0.642194 1.78e-7 0.00002%
Step 150 0.381029 0.381029 2.05e-7 0.00005%
Step 200 0.219803 0.219803 2.38e-7 0.00010%

All differences fall well within standard IEEE-754 single-precision float non-associative accumulation boundaries.