gabriel / muse public
feat BREAKING task/wire-perf #1 / 1
AI Agent gabriel · 153 days ago · Apr 22, 2026 · Diff

feat: activate CHUNK_OBJECTS batching, delta+zlib encoding, HTTP/2 via httpx

- push.py: split large pushes into CHUNK_OBJECTS=500 batches (avoids Cloudflare 100 MB upload limit); non-final batches send no commits/snapshots - push.py: attempt compute_delta against remote OID for each object that shares a path with the tip of branch_have; fall back to raw on ValueError - pack.py: add optional sz field to ObjectPayload (uncompressed byte count required for delta+zlib so server can pre-allocate before decompression) - transport.py: add HTTPX_AVAILABLE + _httpx_mod optional import; route HTTPS push_stream through new _push_stream_httpx (HTTP/2 via httpx.Client) while plain HTTP continues to use http.client chunked transfer - tests: 16 tests for T9 chunking, T10 delta encoding, 8 tests for T11/T12 HTTP/2 transport (71 total passing, 0 failing)

sha256:d61de967213b2f11699cbafb296606e0fe907fc6a6cc9744327ae71980eef8d0 sha
+56 ~4 symbols
sha256:54ffd5bacb164b183705df4bfc6f1490f9fb5804938aef08be4fe3f94387d42f snapshot
+56
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 60 symbols
~ tests/test_transport_http2.py .py 29 symbols added
+ TestT11HttpxFlag class class TestT11HttpxFlag L56–72
+ test_httpx_available_is_bool method method test_httpx_available_is_bool L59–61
+ test_httpx_available_true_when_httpx_installed method method test_httpx_available_true_when_httpx_installed L63–72
+ TestT12PushStreamHttp2 class class TestT12PushStreamHttp2 L79–217
+ _push method method _push L97–120
+ mock_httpx method method mock_httpx L83–95
+ test_http1_fallback_when_httpx_unavailable method method test_http1_fallback_when_httpx_unavailable L146–180
+ test_http_url_always_uses_http1 method method test_http_url_always_uses_http1 L182–217
+ test_httpx_client_is_instantiated method method test_httpx_client_is_instantiated L122–124
+ test_httpx_client_uses_http2_true method method test_httpx_client_uses_http2_true L126–131
+ test_httpx_stream_posts_to_push_stream_endpoint method method test_httpx_stream_posts_to_push_stream_endpoint L133–140
+ test_result_ok_parsed_from_r_frame method method test_result_ok_parsed_from_r_frame L142–144
+ _make_objects function function _make_objects L45–49
+ _make_progress_frame function function _make_progress_frame L31–32
+ _make_result_frame function function _make_result_frame L27–28
+ _mock_httpx_response function function _mock_httpx_response L35–42
+ _oid function function _oid L23–24
+ Any import import Any L13–13
+ MagicMock import import MagicMock L14–14
+ ObjectPayload import import ObjectPayload L19–19
+ PushResult import import PushResult L19–19
+ annotations import import annotations L9–9
+ blob_id import import blob_id L20–20
+ call import import call L14–14
+ io import import io L11–11
+ msgpack import import msgpack L16–16
+ patch import import patch L14–14
+ pathlib import import pathlib L12–12
+ pytest import import pytest L17–17
~ muse/cli/commands/push.py .py 1 symbol modified
~ muse/core/pack.py .py 1 symbol modified
~ muse/core/transport.py .py 1 symbol added, 2 symbols modified
+ _push_stream_httpx method method _push_stream_httpx L1200–1300
~ tests/test_cli_stream_push.py .py 26 symbols added
+ DeltaRepoInfo class class DeltaRepoInfo L833–838
+ TestT10DeltaEncoding class class TestT10DeltaEncoding L1007–1089
+ _run_delta method method _run_delta L1010–1033
+ test_delta_encoding_used_for_changed_file method method test_delta_encoding_used_for_changed_file L1035–1043
+ test_delta_object_has_base_id method method test_delta_object_has_base_id L1053–1059
+ test_delta_object_has_correct_encoding_field method method test_delta_object_has_correct_encoding_field L1045–1051
+ test_delta_object_has_sz_set_to_raw_size method method test_delta_object_has_sz_set_to_raw_size L1061–1068
+ test_no_delta_for_new_file method method test_no_delta_for_new_file L1080–1089
+ test_no_delta_without_branch_have method method test_no_delta_without_branch_have L1070–1078
+ TestT9ObjectChunking class class TestT9ObjectChunking L895–1000
+ _run method method _run L898–923
+ test_each_batch_object_count_bounded method method test_each_batch_object_count_bounded L972–978
+ test_exact_chunk_boundary_is_one_call method method test_exact_chunk_boundary_is_one_call L995–1000
+ test_final_batch_has_all_commits method method test_final_batch_has_all_commits L955–961
+ test_final_batch_has_local_head method method test_final_batch_has_local_head L963–970
+ test_large_push_calls_transport_multiple_times method method test_large_push_calls_transport_multiple_times L925–930
+ test_non_final_batches_have_no_commits method method test_non_final_batches_have_no_commits L932–938
+ test_non_final_batches_have_no_local_head method method test_non_final_batches_have_no_local_head L947–953
+ test_non_final_batches_have_no_snapshots method method test_non_final_batches_have_no_snapshots L940–945
+ test_small_push_still_one_call method method test_small_push_still_one_call L988–993
+ test_total_objects_across_batches_equals_objects_sent method method test_total_objects_across_batches_equals_objects_sent L980–986
+ _build_commit function function _build_commit L778–810
+ _write_file_object function function _write_file_object L766–775
+ delta_repo function function delta_repo L842–888
+ dataclass class import dataclass L829–829
+ multi_object_repo function function multi_object_repo L814–826
← Older Oldest on task/wire-perf
All commits
Newer → Latest on task/wire-perf

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:d61de967213b2f11699cbafb296606e0fe907fc6a6cc9744327ae71980eef8d0 --body "your comment"