Repository navigation
Add native attribution baselines to benchmark harness - #1265
Merged
Merged
Conversation
This was referenced Oct 3, 2026
godofecht
force-pushed
the
devin/native-baselines
branch
from
October 7, 2026 08:10
17991b4 to
f163857
Compare
Contributor
Author
|
Rebased onto main 97fc916 for merge. Conflicts in docs/nav.json and CHANGELOG kept both sides. main gained the #737 FFI runtime rows (ffi_scalar, ffi_batch, ffi_buffer) after this branch was cut, so |
The cross-harness now discovers hand-written C twins under benchmarks/baselines/native, compiles them with the Flow C backend's optimization flags, and records their metrics beside the Flow and CPython subjects. Each row reports flow_vs_python, flow_vs_native and python_vs_native ratios so runtime losses can be attributed to generated code instead of folded into an interpreter comparison. Initial native subjects cover the eight runtime primitives. The harness test checks the extended JSON shape. Refs #745
Fill native C twins so they do the same work as Flow, add hashmap, heapsort+search and reduction rows, and teach the harness to require a native twin and classify flow_vs_native tax. hash_string is djb2; hash_i64 is an fmix mix; the i64 map grows before load 1/2. Part of #745 Co-authored-by: Abhishek Shivakumar <[email protected]>
Enable FLOW_MEM_PROFILE only on the memory suite, scale allocation and array rows so they are not startup noise, and type collections.flow calloc as i64 so the hashmap lang test typechecks. Part of #745 Co-authored-by: Abhishek Shivakumar <[email protected]>
main gained runtime/ffi_scalar, ffi_batch and ffi_buffer (#1352) after this branch was cut, so --check-runtime-natives failed on the rebase. Each twin makes the same noinline call from C, so flow_vs_native is the cost of the Flow side of the crossing. Also rewords four sentences in runtime-primitive-attribution.md that the prose lint rejects.
install-stdlib and add-stdlib pin the cksum of lib/stdlib/collections.flow, which this branch rewrites. scripts/check_pkg_parity.flow: pass=134 fail=0.
…orkloads allocation, arrays, numerical and sorting under benchmarks/cross_harness/runtime changed on this branch, so their recorded MLIR digests in compiler/fixtures/mlir/corpus.txt changed too. Only those four lines move. parity_mlir: corpus programs=2526 fail=0.
godofecht
force-pushed
the
devin/native-baselines
branch
from
October 7, 2026 09:31
546c2fe to
cd54266
Compare
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
Port of the startup cohort from the original #1410 branch onto main after #1265 (native baselines). The startup_* rows reuse the cold sources and twins, build the Flow program before timing, and every row now carries a timing_scope. The draft's profile flag is dropped: main already profiles only the memory suite (#1341).
This was referenced Oct 7, 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.
Summary
benchmarks/baselines/native/cross_harness.clang -O3 -march=native -lmflags used by the Flow C backend harness.native_command,native_metricsandflow_vs_python,flow_vs_native,python_vs_nativeratios.Test plan
flow tool tests/bench_harness/run.flowflow tool bench_harness --smoke --out /tmp/flow-native-bench.jsonclang -O3 -march=native -lmSmoke evidence
bench_harness: pass=47 fail=0Refs #745