Add networkx-full-port: optimize full NetworkX clone for speed#1
Open
AllenGrahamHart wants to merge 2 commits intoharbor-framework:mainfrom
Open
Add networkx-full-port: optimize full NetworkX clone for speed#1AllenGrahamHart wants to merge 2 commits intoharbor-framework:mainfrom
AllenGrahamHart wants to merge 2 commits intoharbor-framework:mainfrom
Conversation
MVP infrastructure for a long-horizon challenge where agents optimize a complete clone of NetworkX 3.4.2 (renamed to fast_networkx) for speed while maintaining correctness against the networkx test suite. - 3,369 correctness tests (95% pass rate gate) - VF2++ speed benchmark with correctness assertion - Verifier force-reinstalls pinned networkx==3.4.2 (tamper-proof) - 1000-hour agent timeout for long-horizon optimization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AllenGrahamHart
pushed a commit
that referenced
this pull request
Mar 6, 2026
* Add Harbor task format resources from terminal-bench This populates the benchmark template with: - PR template for task contribution checklist - 7 GitHub Actions workflows for automated QA checks - 7 bash validation scripts - Hello-world example task in Harbor format - Comprehensive README with documentation Resources adapted from harbor-framework/terminal-bench#1383. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
Speed Benchmarks Expanded: 1 → 10 AlgorithmsExpanded the speed benchmark suite from a single VF2++ benchmark to 10 diverse algorithms, covering 3 graph types and 8 distinct computational patterns. Algorithms Added
Oracle VerificationFiles Changed
Design Notes
|
Add 9 new benchmark functions to test_speed.py covering: - betweenness_centrality (all-pairs BFS) - all_pairs_dijkstra_path_length (n x Dijkstra) - find_cliques (Bron-Kerbosch backtracking) - greedy_modularity_communities (greedy optimization) - minimum_spanning_tree (Kruskal sort + union-find) - pagerank (power iteration on DiGraph) - maximum_flow_value (Edmonds-Karp augmenting paths) - average_clustering (triangle counting) - all_pairs_bellman_ford_path_length (n x Bellman-Ford on MultiDiGraph) Each benchmark calibrated to ~5-15s on vanilla networkx, uses interleaved nx/fnx timing with GC control, and includes correctness assertions. Also adds 3 new correctness tests to test_correctness_benchmark.py for greedy_modularity_communities, all_pairs_dijkstra_path_length, and all_pairs_bellman_ford_path_length. Oracle verified: 3383 passed, 0 failed, reward=1.0, geo_mean_reltime=0.990, total runtime 15:14 (well within 1-hour verifier timeout). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Task: Fast NetworkX Full Port
Optimize a complete clone of NetworkX for speed while maintaining correctness.
The agent starts with
fast_networkx— a full clone of NetworkX 3.4.2 (~500 algorithms, ~566 Python files) with all internal references renamed. The goal: make it as fast as possible using any technique (Rust extensions, Cython, algorithm improvements, better data structures, SIMD, parallelism) while passing the NetworkX test suite.Why this task matters
A successful port would produce something genuinely valuable: a fully backwards-compatible drop-in replacement for NetworkX that is dramatically faster. This isn't a toy benchmark — it's real-world optimization of one of the most widely used Python libraries (>30M monthly downloads). The output is directly usable by the scientific computing community.
Evaluation
fast_networkx. The agent cannot see or tamper with the test source.The reward is currently binary (1 if correctness passes, 0 otherwise). The speed metric is reported for ranking.
Current state (MVP)
Remaining work
Estimated agent effort
In a related mini-port task (VF2++ only), Claude achieved a 100x speedup in ~30 minutes by rewriting the algorithm in Rust via PyO3. NetworkX contains ~500 algorithms. Extrapolating, a comprehensive optimization effort could take ~250 hours of agent work — making this a true long-horizon challenge (agent timeout is set to 1,000 hours).
Test plan
🤖 Generated with Claude Code