5 Commits

Author SHA1 Message Date
3747af6ccc Merge branch 'test/pin-the-xet-fallback'
All checks were successful
deploy / build-web (push) Successful in 2m12s
deploy / build (push) Successful in 6m45s
deploy / deploy (push) Successful in 18s
deploy / deploy-web (push) Successful in 14s
The conformance suite was disabling Xet client-side, so the downstream half
of spec §8 -- and with it the claim that pointing HF_ENDPOINT at rustingface
works with the client people actually have -- was never exercised. The suite
now runs a Xet-capable client throughout and asserts it still chooses HTTP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqNtYNhov3fukx46KS9R7L
2026-09-02 18:55:04 +03:00
32c8a3c2b5 test(conformance): stop disabling Xet, so the fallback is actually tested
All checks were successful
ci / web (push) Successful in 1m41s
ci / check (push) Successful in 6m40s
The suite set `HF_HUB_DISABLE_XET=1` in the client environment. That is not
a configuration anyone runs: `hf_xet` installs as a `huggingface_hub`
dependency, so a real user's client is Xet-capable whether they asked for
it or not. Every conformance run so far has therefore been proving
something about a client with Xet switched off by the harness, and nothing
at all about the one rustingface has to work with.

That matters more than it sounds. Downstream Xet behaviour is half of spec
§8 and it is the half exposed to the Hub's migration: rustingface
implements no Xet, so the whole "point HF_ENDPOINT at it and everything
works" claim rests on a Xet-capable client *choosing* HTTP. That choice was
untested.

Stop disabling it, and add a check that asserts the choice from inside the
client rather than by inspecting our own headers -- the question is not
which headers we sent but what the client concluded from them. It refuses
to pass vacuously: if `hf_xet` is absent it fails loudly rather than
quietly proving nothing, which is how the harness's own opt-out was found.

The full suite passes with Xet enabled, 12 checks. So the posture in spec §8
holds against a real client, and now says so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqNtYNhov3fukx46KS9R7L
2026-09-02 15:06:17 +03:00
93cc64baf3 Merge branch 'fix/followers-stream-from-the-transfer'
All checks were successful
deploy / build (push) Successful in 6m34s
deploy / deploy (push) Successful in 52s
deploy / build-web (push) Successful in 1m36s
deploy / deploy-web (push) Successful in 17s
A request that joined another request's in-flight fetch waited with nothing
on the wire until the whole transfer finished. The leader now spools each
chunk as it passes and followers stream from it, which is the broadcast
spec §7 asked for.

Closes #2

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqNtYNhov3fukx46KS9R7L
2026-09-02 14:44:01 +03:00
d1b1cdf3de Merge branch 'fix/bounded-cold-range-does-not-stall'
All checks were successful
deploy / build-web (push) Successful in 1m45s
deploy / build (push) Successful in 6m33s
deploy / deploy (push) Successful in 33s
deploy / deploy-web (push) Successful in 10s
A cold range stopping short of the end handed the client its bytes and then
stalled it on a tail that cannot be released until the whole file is
verified. It is now answered 503 while the fetch runs on.

Closes #4

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqNtYNhov3fukx46KS9R7L
2026-09-02 14:34:13 +03:00
a88bbd1ee2 Merge branch 'fix/drain-does-not-wait-on-blob-streams'
All checks were successful
deploy / build-web (push) Successful in 1m47s
deploy / build (push) Successful in 6m33s
deploy / deploy (push) Successful in 1m19s
deploy / deploy-web (push) Successful in 16s
A restart during a long download stalled the drain until TimeoutStopSec
expired and systemd escalated to SIGABRT. The drain is now bounded by
server.shutdown_grace and exits cleanly.

Closes #3

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqNtYNhov3fukx46KS9R7L
2026-09-02 14:24:47 +03:00
2 changed files with 70 additions and 4 deletions

View File

@@ -461,7 +461,11 @@ file reconstruction information from a CAS rather than a URL. rustingface
implements none of it.
- **Downstream:** never advertise Xet capability. Clients then take the ordinary
resolve-and-redirect path.
resolve-and-redirect path. This is the half that has to keep working as the
Hub migrates, so the conformance suite runs a *Xet-capable* client — `hf_xet`
installs as a `huggingface_hub` dependency whether or not a user asks for it
— and asserts it still chooses HTTP. Testing it with Xet disabled client-side
would prove nothing about the configuration people actually run.
- **Upstream:** set `HF_HUB_DISABLE_XET=1` semantics on outbound fetches so
rustingface receives whole-file URLs via the Git LFS bridge, which reconstructs
the file and returns a single resource URL for legacy clients. Storing whole

View File

@@ -208,9 +208,14 @@ def client_env(endpoint: str, home: Path) -> dict:
"HF_ENDPOINT": endpoint,
"HF_HOME": str(home),
"HF_HUB_CACHE": str(home / "hub"),
# rustingface implements no Xet client and never advertises the
# capability; setting this makes the client's side explicit too.
"HF_HUB_DISABLE_XET": "1",
# Xet is deliberately *not* disabled here. `hf_xet` installs as a
# huggingface_hub dependency, so a real user's client is Xet-capable
# whether or not they asked for it, and the whole claim rustingface
# makes is that pointing HF_ENDPOINT at it works with the client
# people actually have. Setting HF_HUB_DISABLE_XET would test a
# configuration nobody runs, and would hide the one failure mode
# that matters here: a client choosing Xet against a service that
# implements none of it (spec §8).
"HF_HUB_DISABLE_TELEMETRY": "1",
"HF_HUB_DISABLE_PROGRESS_BARS": "1",
}
@@ -270,6 +275,32 @@ meta = get_hf_file_metadata(url)
print(json.dumps({{"commit": meta.commit_hash, "etag": meta.etag, "size": meta.size}}))
"""
# The Xet negotiation, from the client's own side. `hf_xet` ships as a
# huggingface_hub dependency, so a real user's client is Xet-capable whether or
# not they asked for it. What keeps rustingface compatible is that the *server*
# never advertises Xet: `parse_xet_file_data_from_response` returns None, and
# `hf_hub_download` dispatches to plain HTTP (file_download.py, "if
# xet_file_data is not None and is_xet_available()").
#
# Asserted from inside the client rather than by inspecting headers ourselves,
# because the question is not "which headers did we send" but "what did the
# client conclude from them".
XET_FALLBACK = """
import json
from huggingface_hub import get_session, hf_hub_url
from huggingface_hub.utils._runtime import is_xet_available
from huggingface_hub.utils._xet import parse_xet_file_data_from_response
url = hf_hub_url({repo!r}, "config.json", revision={revision!r})
response = get_session().get(url, headers={{"Accept-Encoding": "identity"}}, allow_redirects=False)
response.raise_for_status()
print(json.dumps({{
"xet_capable": bool(is_xet_available()),
"xet_offered": parse_xet_file_data_from_response(response) is not None,
"xet_headers": sorted(h for h in response.headers if h.lower().startswith("x-xet-")),
}}))
"""
MISSING_FILE = """
import json
from huggingface_hub import hf_hub_download
@@ -451,6 +482,37 @@ def main() -> int:
results.check("model_info answers through rustingface", model_info)
def xet_capable_client_falls_back_to_http() -> None:
"""The central compatibility claim: point HF_ENDPOINT here and it works.
Xet is the thing most likely to break that quietly. The Hub is moving to
it, `hf_xet` is installed alongside `huggingface_hub` whether or not the
user asked for it, and rustingface implements none of it (spec §8) --
deliberately, because a Xet-backed fetch would leave the bucket
unreadable without a Xet client. That only holds while the client
*chooses* HTTP, so assert the choice rather than assume it.
"""
with Instance(args.binary, workdir, storage, open_upstream) as rf:
seen = json.loads(
run_client(XET_FALLBACK.format(repo=REPO, revision=REVISION), rf.endpoint, hf_home)
)
if not seen["xet_capable"]:
raise Failure(
"hf_xet is not installed, so this check proves nothing: it would pass against a "
"client that could not use Xet even if rustingface offered it. Install the pinned "
"requirements."
)
if seen["xet_offered"] or seen["xet_headers"]:
raise Failure(
"rustingface advertised Xet to the client "
f"(headers {seen['xet_headers']}). It implements none of it, and a client that "
"took that path would write a bucket nobody can read back without a Xet client, "
"which forfeits state portability (spec §8)."
)
print(" client is Xet-capable, rustingface offered no Xet, download stays on HTTP")
results.check("a Xet-capable client falls back to plain HTTP", xet_capable_client_falls_back_to_http)
# ------------------------------------------------------------------
# Failures are loud.
# ------------------------------------------------------------------