cubical-transport-hott-lean4/lakefile.toml
Maximus Gorog c2e3ecb3e3
Some checks are pending
Lean Action CI / build (push) Waiting to run
Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI
Implements the cells-spec vision: a computation space that preserves
auditability, correctness, interactivity. Phase 1 (Lean kernel +
naga-IR Rust backend) is closed; foundation hypothesis stack
(Selection H1+H2, Subobject H3, Trace H5, Obs.Ctx C2, Cubical.Trace)
landed.

Highlights:
- Cubical-HoTT syntax + value/eval/readback in Lean
- naga-IR pipeline (no GLSL string crosses FFI; 17/17 probes pass)
- Honesty audit: every non-transport (sealed cells, vertex shader,
  Y-flip, presentation conventions) is documented as such
- Polymorphic Trace α as free monoid; Cubical.Trace gives
  CTerm → Trace CTerm by structural fold (homomorphism = definition)
- Selection as Huet zipper; Subobject as Boolean algebra over WCell
- All theorems proven; the proof IS the implementation

See STATUS.md for the resume guide.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 20:40:45 -06:00

111 lines
5 KiB
TOML

name = "topolei"
version = "0.1.0"
defaultTargets = ["topolei", "cubical-test"]
[[lean_lib]]
name = "Topolei"
[[lean_exe]]
name = "cubical-test"
root = "CubicalTest"
# Runs Phase C.3 smoke tests + Phase D.1 property tests on the
# Rust-backed cubical evaluator. No GPU dependencies.
moreLinkArgs = [
"./native/cubical/target/release/libtopolei_cubical.a",
]
[[lean_exe]]
name = "cubical-bench"
root = "CubicalBench"
# Phase D.2 performance benchmarks on the Rust-backed evaluator.
moreLinkArgs = [
"./native/cubical/target/release/libtopolei_cubical.a",
]
[[lean_exe]]
name = "topolei"
root = "Main"
moreLinkArgs = [
# Rust canvas (wgpu + winit + naga-glsl) — replaces the OpenGL/GLFW C++
# canvas.cpp. Provides topolei_run / topolei_run2 declared in
# Topolei/Canvas.lean. Targets Vulkan/Metal/DX12/WebGPU under wgpu.
"./native/canvas-rs/target/release/libtopolei_canvas.a",
# Rust cubical-HoTT backend (topolei-cubical) built by build.sh via cargo.
# Provides topolei_cubical_* symbols declared in Topolei/Cubical/FFI.lean.
"./native/cubical/target/release/libtopolei_cubical.a",
# NOTE: the render crate (libtopolei_render.a) is not linked here — it
# and canvas-rs each embed their own copy of the Rust runtime, which
# collides at static-link time (rust_eh_personality et al.). The render
# crate will be merged into canvas-rs, or one of the two made a cdylib,
# when render actually has load-bearing FFI.
# System libs needed by wgpu (Vulkan driver loader + X11 for winit) and
# glibc (TLS symbols via __tls_get_addr required by wgpu's dlopen path).
# Match Lean's toolchain glibc path so __tls_get_addr resolves from the
# same DSO ld-linux-x86-64.so.2 the final executable will load.
# Explicitly include libc.so.6 + ld-linux-x86-64.so.2 — wgpu's statically-
# linked Rust code references __tls_get_addr, resolved only by the
# dynamic linker DSO. Paths point at Lean's toolchain glibc.
# Avoid -L/run/current-system/sw/lib because its libc.a leaks
# __open_nocancel/_setjmp into the static link. Point -L at each lib's
# nix-store dir individually.
"-Wl,--no-as-needed",
"/nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/libc.so.6",
"/nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/ld-linux-x86-64.so.2",
"-L/nix/store/7h3p5dm7p8wrbdm7ssb3mybvcjm5f79p-vulkan-loader-1.4.328.0/lib",
"-L/nix/store/2yvh4kwhfd65dcd3r6y6bgdwclfndvzr-libX11-1.8.12/lib",
"-L/nix/store/xwd1s74zk3bwilv4p02284ckyy319vhz-libxcb-1.17.0/lib",
"-L/nix/store/k9ab9lfy15l7br6iagxiwdgdi9kkby88-libxkbcommon-1.8.1/lib",
"-lvulkan",
"-lX11",
"-lxcb",
"-lxkbcommon",
"-ldl",
"-lpthread",
"-lm",
"-lgcc_s",
# RPATH: bake library search paths into the binary so winit's runtime
# dlopen() calls find libXcursor.so.1, libXi.so.6, libXrandr.so.2,
# libXext.so, etc. without the user setting LD_LIBRARY_PATH.
"-Wl,-rpath,/nix/store/7h3p5dm7p8wrbdm7ssb3mybvcjm5f79p-vulkan-loader-1.4.328.0/lib",
"-Wl,-rpath,/nix/store/c0z5kfib8j6xcmbkdknwkkqy38nwph4c-libXcursor-1.2.3/lib",
"-Wl,-rpath,/nix/store/frfb398wg8imfw5r0ac18gy389by0vap-libXi-1.8.2/lib",
"-Wl,-rpath,/nix/store/fxw37cf0j4zp5xagyq0j144536qwc9q4-libXrandr-1.5.4/lib",
"-Wl,-rpath,/nix/store/yzd9jj5q0ad2dzpmxhfs0ssp4ddq2j2r-ld-library-path/share/nix-ld/lib",
"-Wl,-rpath,/nix/store/2v2nlnxm34grn5iq1s1n4di9vsn3k4si-libXext-1.3.6/lib",
]
[[lean_exe]]
name = "probe-test"
root = "ProbeTest"
# Empirical check for `render_faithful` (Topolei/GPU/Spec.lean).
# Uses the `topolei_canvas_render_probe_pixel` FFI to render a handful
# of known shaders offscreen and compare GPU pixel output against the
# Lean-side ShaderSemantic. Requires a GPU adapter or software
# rasterizer at runtime; the probe gracefully returns a sentinel and
# the test SKIPs when none is available. Link args mirror the
# interactive `topolei` exe since canvas-rs pulls the same wgpu /
# Vulkan / X11 stack (winit is compiled in but not used at probe time).
moreLinkArgs = [
"./native/canvas-rs/target/release/libtopolei_canvas.a",
"-Wl,--no-as-needed",
"/nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/libc.so.6",
"/nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/ld-linux-x86-64.so.2",
"-L/nix/store/7h3p5dm7p8wrbdm7ssb3mybvcjm5f79p-vulkan-loader-1.4.328.0/lib",
"-L/nix/store/2yvh4kwhfd65dcd3r6y6bgdwclfndvzr-libX11-1.8.12/lib",
"-L/nix/store/xwd1s74zk3bwilv4p02284ckyy319vhz-libxcb-1.17.0/lib",
"-L/nix/store/k9ab9lfy15l7br6iagxiwdgdi9kkby88-libxkbcommon-1.8.1/lib",
"-lvulkan",
"-lX11",
"-lxcb",
"-lxkbcommon",
"-ldl",
"-lpthread",
"-lm",
"-lgcc_s",
"-Wl,-rpath,/nix/store/7h3p5dm7p8wrbdm7ssb3mybvcjm5f79p-vulkan-loader-1.4.328.0/lib",
"-Wl,-rpath,/nix/store/c0z5kfib8j6xcmbkdknwkkqy38nwph4c-libXcursor-1.2.3/lib",
"-Wl,-rpath,/nix/store/frfb398wg8imfw5r0ac18gy389by0vap-libXi-1.8.2/lib",
"-Wl,-rpath,/nix/store/fxw37cf0j4zp5xagyq0j144536qwc9q4-libXrandr-1.5.4/lib",
"-Wl,-rpath,/nix/store/yzd9jj5q0ad2dzpmxhfs0ssp4ddq2j2r-ld-library-path/share/nix-ld/lib",
"-Wl,-rpath,/nix/store/2v2nlnxm34grn5iq1s1n4di9vsn3k4si-libXext-1.3.6/lib",
]