Lab code
The starters you type into, the tests that judge them, and the worked code the book prints.
Foundations to Frontier: companion code
Caleb Kious
Each folder holds the starters you type into, the tests that judge them, and the worked code the
book prints. The core Python labs use Python 3.13 and only its standard library; the AI Lab and
the Engineering Lab use Python 3.14 (eng-lab/pyproject.toml lists the engine's packages). The C++
labs need a C++20 compiler.
code/ core labs (Parts II-IV): starters/, tests/, solutions/, cpp/
integration_code/ the workshops (W01-W08)
graduate_code/ the graduate core (Part IX) and its two capstone projects
frontier_code/ F01 (feedback control) and F19 (performance engineering), Part X
ai-lab/ AI Lab Module 1 (Part XI): m01_autograd/ and tools/viz.py
eng-lab/ Engineering Lab (Part XII): the hardware engine hwe/ and labs/el01_hover/
geo-code/ Geometry (Part XIII): m01/angles.cpp
cp/ Algorithms Lane (Part XIV): cp01/
Each chapter says how to run its lab. Attempt every step before you look at a solution, and let the
tests be the judge.
© 2026 Caleb Kious. A licence for reuse has not been chosen yet; until one is posted here, the code is provided for your own study alongside the book.
- ai-lab/
- m01_autograd/
- tests/
- _impl.py642 bytes
- test_engine.py12,558 bytes
- test_gradcheck.py2,936 bytes
- test_nn.py3,821 bytes
- test_train.py2,441 bytes
- check.py3,928 bytes
- engine.py6,645 bytes
- gradcheck.py1,630 bytes
- nn.py3,129 bytes
- train.py2,645 bytes
- tools/
- viz.py25,149 bytes
- code/
- cpp/
- bounded_queue.hpp1,663 bytes
- layout_benchmark.cpp1,641 bytes
- ownership.hpp1,243 bytes
- spatial.hpp5,608 bytes
- spatial_benchmark.cpp2,144 bytes
- examples/
- add.cpp152 bytes
- fixtures/
- grid.json90 bytes
- latency.csv112 bytes
- gpu/
- reduce.cu2,961 bytes
- solutions/
- __init__.py70 bytes
- algorithms_lab.py1,373 bytes
- automata_lab.py1,095 bytes
- control_lab.py2,054 bytes
- database_lab.py2,316 bytes
- discrete_lab.py732 bytes
- framing_lab.py1,605 bytes
- graph_lab.py1,240 bytes
- hash_lab.py1,728 bytes
- interpreter_lab.py3,301 bytes
- least_squares_lab.py1,527 bytes
- linear_lab.py1,029 bytes
- logic_lab.py862 bytes
- ml_lab.py4,753 bytes
- numerics_lab.py2,235 bytes
- ode_lab.py1,776 bytes
- orbit_lab.py1,500 bytes
- pathfinding.py3,089 bytes
- probability_lab.py826 bytes
- reduction_lab.py924 bytes
- representation_lab.py1,093 bytes
- retry_lab.py1,152 bytes
- search_lab.py500 bytes
- security_lab.py714 bytes
- service.py6,697 bytes
- simulation_cli.py1,379 bytes
- statistics_lab.py1,209 bytes
- telemetry_cli.py2,686 bytes
- testing_lab.py1,122 bytes
- trace_lab.py460 bytes
- starters/
- cpp/
- bounded_queue.hpp666 bytes
- layout_benchmark.cpp350 bytes
- ownership.hpp822 bytes
- spatial.hpp1,008 bytes
- __init__.py70 bytes
- algorithms_lab.py497 bytes
- automata_lab.py723 bytes
- control_lab.py636 bytes
- database_lab.py859 bytes
- discrete_lab.py424 bytes
- framing_lab.py794 bytes
- graph_lab.py485 bytes
- hash_lab.py1,060 bytes
- interpreter_lab.py1,526 bytes
- least_squares_lab.py429 bytes
- linear_lab.py371 bytes
- logic_lab.py563 bytes
- ml_lab.py989 bytes
- numerics_lab.py851 bytes
- ode_lab.py528 bytes
- orbit_lab.py675 bytes
- pathfinding.py1,379 bytes
- probability_lab.py394 bytes
- reduction_lab.py542 bytes
- representation_lab.py664 bytes
- retry_lab.py628 bytes
- search_lab.py446 bytes
- security_lab.py551 bytes
- service.py1,222 bytes
- simulation_cli.py506 bytes
- statistics_lab.py473 bytes
- telemetry_cli.py826 bytes
- testing_lab.py569 bytes
- trace_lab.py374 bytes
- tests/
- ownership_test.cpp739 bytes
- queue_test.cpp1,135 bytes
- spatial_test.cpp1,424 bytes
- test_labs.py16,932 bytes
- test_projects.py8,940 bytes
- test_validation.py1,321 bytes
- tools/
- prepare_starters.py1,315 bytes
- verification/
- add_x86_64_gcc14.s271 bytes
- cpu_visible_at_final_check.txt3,240 bytes
- environment.json430 bytes
- experiments.json878 bytes
- layout_benchmark.txt115 bytes
- spatial_benchmark.txt149 bytes
- CMakeLists.txt1,610 bytes
- lab_manifest.json5,551 bytes
- README.md8,840 bytes
- cp/
- eng-lab/
- data/
- catalog/
- materials.toml554 bytes
- tmotor_air2216ii_920kv_t1045_16v.csv612 bytes
- tests/
- el01_phone/
- .gitkeep0 bytes
- design/
- drone.toml5,444 bytes
- progress.toml302 bytes
- requirements.toml1,292 bytes
- hwe/
- cad/
- __init__.py0 bytes
- boundary.py1,605 bytes
- drawing.py3,768 bytes
- core/
- __init__.py1,851 bytes
- arm.py2,941 bytes
- energy.py2,608 bytes
- hover.py5,556 bytes
- kinematics.py2,309 bytes
- massbudget.py3,062 bytes
- report/
- __init__.py0 bytes
- charts.py4,705 bytes
- html.py14,593 bytes
- __init__.py0 bytes
- __main__.py8,019 bytes
- catalog.py3,126 bytes
- design.py5,886 bytes
- pipeline.py17,756 bytes
- requirements.py4,717 bytes
- testdata.py2,705 bytes
- units.py6,368 bytes
- labs/
- el01_hover/
- tests/
- _impl.py850 bytes
- test_arm.py3,903 bytes
- test_energy.py3,398 bytes
- test_hover.py8,377 bytes
- test_kinematics.py5,019 bytes
- test_massbudget.py3,895 bytes
- test_requirements.py3,255 bytes
- test_tinker.py1,229 bytes
- check.py4,842 bytes
- predictions.toml1,088 bytes
- .gitignore43 bytes
- pyproject.toml615 bytes
- frontier_code/
- solutions/
- __init__.py0 bytes
- control_lab.py12,207 bytes
- perf_lab.py11,142 bytes
- starters/
- __init__.py0 bytes
- control_lab.py12,070 bytes
- perf_lab.py10,540 bytes
- tests/
- test_frontier.py7,819 bytes
- test_perf.py5,005 bytes
- README.md1,283 bytes
- verify_f01.py3,255 bytes
- verify_f19.py2,290 bytes
- geo-code/
- m01/
- angles.cpp2,945 bytes
- graduate_code/
- cpp/
- starters/
- matrix.hpp1,096 bytes
- benchmark.cpp1,455 bytes
- matrix.hpp2,287 bytes
- test_matrix.cpp1,444 bytes
- solutions/
- __init__.py76 bytes
- attention.py1,749 bytes
- compiler.py9,483 bytes
- contracts.py1,352 bytes
- data.py3,615 bytes
- distributed.py1,743 bytes
- ethics.py1,816 bytes
- evidence.py2,822 bytes
- flow.py2,053 bytes
- language.py2,570 bytes
- ml.py2,840 bytes
- network.py2,405 bytes
- neural.py2,766 bytes
- numerics.py2,100 bytes
- planning.py2,123 bytes
- research.py1,717 bytes
- scoring.py10,414 bytes
- starters/
- __init__.py150 bytes
- attention.py385 bytes
- compiler.py840 bytes
- contracts.py541 bytes
- data.py789 bytes
- distributed.py889 bytes
- ethics.py423 bytes
- evidence.py649 bytes
- flow.py401 bytes
- language.py484 bytes
- ml.py772 bytes
- network.py437 bytes
- neural.py670 bytes
- numerics.py277 bytes
- planning.py293 bytes
- research.py578 bytes
- scoring.py2,069 bytes
- tests/
- test_advanced.py16,148 bytes
- CMakeLists.txt1,052 bytes
- README.md706 bytes
- integration_code/
- solutions/
- __init__.py54 bytes
- calculus_bridge.py1,188 bytes
- dag_paths.py2,003 bytes
- dfa_compare.py2,267 bytes
- dual.py1,884 bytes
- graphics.py2,024 bytes
- memory_models.py1,306 bytes
- simulation.py1,733 bytes
- starters/
- __init__.py128 bytes
- calculus_bridge.py825 bytes
- dag_paths.py400 bytes
- dfa_compare.py526 bytes
- dual.py1,561 bytes
- graphics.py379 bytes
- memory_models.py412 bytes
- simulation.py404 bytes
- tests/
- test_workshops.py5,005 bytes
- README.md709 bytes
- README.txt1,073 bytes