{
  "nbformat": 4,
  "nbformat_minor": 5,
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.12.14"
    },
    "research_runtime": {
      "engine": "pyodide",
      "packages": [],
      "assets": [
        "experiment.py",
        "figure_generation.py"
      ],
      "generated_assets": [
        "results.json",
        "figure.svg"
      ],
      "display_assets": [
        "figure.svg"
      ],
      "filesystem_root": ".",
      "network_required": false,
      "validation_engine": "CPython standard-library execution"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# What does a scheduler lose when it ignores job dependencies?\n\nCritical-path calculation and deterministic unit-task scheduling on three four-node DAGs; not graph-network training, Spark measurement, or Decima reproduction.\n\nThis notebook runs the complete saved experiment, checks its assertions, and regenerates the SVG from the computed results. Python 3.10+ and standard-library modules only. Place experiment.py and figure_generation.py beside the notebook. The exact loaded assets are recorded in notebook metadata.\n"
      ],
      "id": "cell-1"
    },
    {
      "cell_type": "code",
      "metadata": {},
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "chain: work=4 critical_path=4 makespan=4 schedule=[['A'], ['B'], ['C'], ['D']]\n",
            "diamond: work=4 critical_path=3 makespan=3 schedule=[['A'], ['B', 'C'], ['D']]\n",
            "independent: work=4 critical_path=1 makespan=2 schedule=[['A', 'B'], ['C', 'D']]\n",
            "Six-task barrier with two workers: work bound=3, path bound=2, actual optimal makespan=4.\n"
          ]
        }
      ],
      "source": [
        "import runpy\n_ = runpy.run_path('experiment.py', run_name='__main__')\n"
      ],
      "id": "cell-2"
    },
    {
      "cell_type": "code",
      "metadata": {},
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Regenerated figure.svg from results.json.\n"
          ]
        }
      ],
      "source": [
        "runpy.run_path('figure_generation.py', run_name='__main__')\n",
        "print('Regenerated figure.svg from results.json.')\n",
        "\n",
        "import base64\n",
        "print('__NOTEBOOK_IMAGE__svg+xml:' + base64.b64encode(open('figure.svg','rb').read()).decode())\n"
      ],
      "id": "cell-3"
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Inspect the saved result\n\nThe article's static figure is available before running code. The regenerated figure.svg uses results.json, and every plotted quantity comes from the experiment.\n\n![Computed figure](figure.svg)\n\nChange an input in experiment.py, rerun both code cells, then compare the saved result and figure.\n"
      ],
      "id": "cell-4"
    }
  ]
}
