Repository navigation
Port the last Python to Flow; ratchet at total 0 - #1076
Merged
Merged
Conversation
godofecht
added a commit
that referenced
this pull request
Sep 29, 2026
godofecht
force-pushed
the
selfhost/mlir-finish
branch
from
September 30, 2026 00:59
901d1e4 to
7751017
Compare
godofecht
force-pushed
the
port/last-python
branch
from
September 30, 2026 10:32
e19dfc9 to
783ba74
Compare
This was referenced Sep 30, 2026
gcc in GNU mode predefines linux as 1, so the generated C read bool 1 = net_is_linux() and the Linux build failed.
This was referenced Sep 30, 2026
Closed
godofecht
added a commit
that referenced
this pull request
Sep 30, 2026
…pty list tests/scripts/repo_stats.sh (from #1076) runs the counter in a scratch tree with a hand-written file list and no git. repo_stats now takes --inputs DIR to read files.txt, meta.txt and mode.txt from DIR, and the test passes it. ./flow test-scripts passes. With the ratchet baseline at total 0, git lists no Python and the file list was a read-only string literal that split_lines wrote into (SIGBUS). The list is now always a heap copy. The ratchet carries #1076's two excluded trees in its git call.
godofecht
added a commit
that referenced
this pull request
Sep 30, 2026
…pty list tests/scripts/repo_stats.sh (from #1076) runs the counter in a scratch tree with a hand-written file list and no git. repo_stats now takes --inputs DIR to read files.txt, meta.txt and mode.txt from DIR, and the test passes it. ./flow test-scripts passes. With the ratchet baseline at total 0, git lists no Python and the file list was a read-only string literal that split_lines wrote into (SIGBUS). The list is now always a heap copy. The ratchet carries #1076's two excluded trees in its git call.
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #1072 (base is
selfhost/mlir-finish; it retargets tomainwhen #1072 merges, and I will rebase then).Ports the last 64 tracked Python files (6,930 lines). After this, the only
.pyfiles are benchmark subjects and the Python side of the interop demo, both excluded by name in the ratchet. The baseline istotal 0, and any other.pyfailsscripts/python_ratchet.sh.Per file
tests/unit,tests/integration, 3__init__.py,tests/conftest.py,pytest.initests/scripts/(same assertions and skip conditions),./flow test-scripts. Pillow is replaced byscripts/tools/gif_check, a GIF89a reader in Flowtests/unit/test_benchmarks.pytests/bench_harness/run.shbenchmarks/run_benchmarks.pyscripts/tools/bench_harnessbehindbenchmarks/run_benchmarks.shcross_harness,publish/python,suite/python,record_numpy.py)benchmarks/baselines/python/. Harnesses run them when python3 is present and skip them otherwisewasm/flow_to_wasm.pyscripts/tools/flow_to_wasmbehindscripts/flow_to_wasm.sh(flow wasm --legacy)examples/interop/simple_interop.py,examples/wasm/python/flow_demo.pyexamples/interop/python/site/wasm-crossings/python/flow_demo.pyexamples/bench/pymatmul.pyscripts/frames_to_gif.pyscripts/tools/frames_to_gif, median cut and Floyd-Steinberg inscripts/tools/lib/gifclip.flow, indexed frames inlib/stdlib/gif.flowscripts/record_demos.pyscripts/tools/record_demosbehindscripts/record_demos.shscripts/playground_compile_server.pyscripts/tools/playground_serverbehindscripts/playground_compile_server.shscripts/ws_echo_relay.pyscripts/tools/ws_echo_relaybehindscripts/ws_echo_relay.sh(RFC 6455, SHA-1 and base64 inscripts/tools/lib/digest.flow)scripts/wiki_contrast.py,scripts/wiki_verify.pyscripts/tools/wiki_browser: drives headless Chrome over the DevTools Protocol from Flow;scripts/wiki_serve.shreplacespython3 -m http.serverscripts/deploy_wiki.pyscripts/deploy_wiki.sh(ssh/scp)tools/audio/*.pyscripts/tools/lattice_allpass(WAV and SVG from Flow, DSP throughlib/stdlib/audio/lattice_allpass.flow)tools/discord-welcome/*.py,requirements.txtscripts/tools/discord_welcome: Gateway and REST over TLS through OpenSSL, with a--replaymode for offline testsParity
Each port recorded the Python outputs and exit codes before deletion.
input.wav.CI
pytestjob is nowconformance(the corpus step only).native-toolsrunstests/scripts/run.shand also triggers on tests, lib and runtime changes.tests/tools/run.shnow covers the wasm converter, the network tools, frames_to_gif, the audio tools and the bot.doc-linksrunstests/bench_harness/run.sh.flow test-pythonis nowflow test-scripts.lintandsecurityjobs still runruff,mypyandbanditonsrc/, which selfhost: finish the MLIR port and delete src/flow #1072 deleted. I left them for a follow-up.Gates
All run with python and python3 stubbed out of PATH. No gate called Python.
bootstrap_from_c.sh --verify,self_host_full.sh,roundtrip.sh.parse_coverage.sh --check,fmt_check.sh --check,tests/cgen/run.sh(102)../flow test-lang(216),corpus_parity.sh --check.parity_*for dap, dynamics_dsl, effects, field_dsl, flow_blocks, lowering, mlir (1252), project_test, proofs and targets.tests/mlir_commands/run.sh(72).tests/scripts/run.sh,tests/tools/run.sh,tests/bench_harness/run.sh(43),tests/pywheel/run.sh(18).parity_shader_dslfails only at the Metal step, which is excepted.tests/conformance/run.shpasses 9 of 11. The two misses are--strictnegatives that wait on selfhost: port the Python type checker to flowc (sem_check) with a parity gate #1071.corpus.txtdigests. They covergif.flowand its two users; flowc and the Python generator at bb23f19 agree on their MLIR.Issues
else ifparse error should suggestelif#986 (else if) and benchmarks/publish: C and generated Flow C do not build on macOS (clock_gettime_nsec_np hidden by _POSIX_C_SOURCE) #964 (benchmarks/publishC on macOS).