[Atp] Re: Floats support summary

Bryan Newbold <bryan@blueskyweb.xyz> Thu, 29 October 2026 19:01 UTC

Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx.ietf.org (Postfix) with ESMTPS id AA95346 for <atp@ietf.org>; Thu, 29 Oct 2026 19:01:17 +0000 (UTC)
Authentication-Results: mx.ietf.org; dkim=pass header.d=blueskyweb.xyz header.s=google header.b=nQwU9pGX; arc=pass ("google.com:s=arc-20260327:i=1"); spf=pass (mx.ietf.org: domain of bryan@blueskyweb.xyz designates 2a00:1450:4864:20::529 as permitted sender) smtp.mailfrom=bryan@blueskyweb.xyz; dmarc=pass (policy=reject) header.from=blueskyweb.xyz
Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-6b1afcd2d23so3928852a12.1 for <atp@ietf.org>; Thu, 29 Oct 2026 12:01:17 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1793300470; cv=none; d=google.com; s=arc-20260327; b=MpNFAAFaGJj6V1oXRsIVkMxVudoQGcSvXbq0Sea+jhieJUW0tWy6HwX/o+pcC0rCS9 s0rGrt9muYEmpHGCdJBnGR5ztTM9eqpqxHfgtMGyJ3PjR9TymXbLpCPLnrJYL/hKPd0F pj+SGzAfBBYmHg7HY7myci06AMqjAPuh/MaJIcsDl97uEjsvWH/WTJVBpgSmxoRNurCn gQNCrFSw1UdwS4Vb7xb50wZiJOMwcDykZLepF2eQhM4DPYCvYxdPlmiN+DV1fsgfcHWi fERAQ9EfuOf1Sgo20kq0Z3auPboboYsJ9cyh+thRO36N4zNUnX0oPwv1X4VHf3g6FLkh 8Ofw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=wPBfSvIZaW6EcogXzVf8lVmV3AoE6KSg3dtWtxNc55I=; fh=Rjzv1ItU+jjgijBfr+UG8EjVAElLoXFo/32wTzxRQN0=; b=LrhHStbFi5y6n+z8TfyepTs8cWAFQ9sZJCnaago5JyjWUNhWbzEd+TqDqwAxK1hIS2 wG3o4GCBOxvLaHsLVdUEbuk3u9ICryMSkZq4vhdaIILaEfku07vVIf8wfFcgAihyuyM8 3xEE3Fdcis6/pPosijTA6dHSf+553+yoxuDjJI+aBILwm4Rjvq1mvLmkhSKqcrHRgdQk fveg3fjVpDZLgWiZ0isKzVUI4tsESULgI3OkJav4yJ0UT2iffobaHVpMydTvoKaTR6uC bWtcpM+Jrv/eYh392BvIGIZKD+LWgA9fQxicCEld/daQOExpOadtoI8nWYiQgc7HrVf6 eU3A==; darn=ietf.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blueskyweb.xyz; s=google; t=1793300470; x=1793905270; darn=ietf.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wPBfSvIZaW6EcogXzVf8lVmV3AoE6KSg3dtWtxNc55I=; b=nQwU9pGXC+wrz7OFd8R2Oz9gBbClVGhaj4bpNxY9FWpaqtfMbs++FYaiGiLDL03Lo0 L7XyjCcsHBQDYyLL9ywufL3YitToDmtJsVZRcXMQjWXyvi5e3qQnMXRXBtVduIlo1Qdc 7FCvxFxhcMNZAkhuT/XK8lxN4NFFp2Rn0LDV8jVvcajqkvNlgkuuuf7YxElqwaMpbTiv 8LrOCyP4M6EIK2bD5CrbIpZrYSOSxN34lgW6mO/65msAn+tcJzqPjLkyDqvwPTMi0SCk URcZwF3G6IWnDrGJtQplj8T25lFI9aMk29NGQ1sin1061+wW+nqtCAU8pTnT8wYugk3g vsoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793300470; x=1793905270; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=wPBfSvIZaW6EcogXzVf8lVmV3AoE6KSg3dtWtxNc55I=; b=qLhSZoMK2lb0aewicWwbuMKAOgueHrRfPcGQuzDkBaj7fDomPMV4Ldzq/v5daYKL8V RzGH5aEe//FA2+ccypOKq4UbzQ3I/GGlyf5E+mHnqo8eFhOG4bLwOsEULvapyXxb2BoT /X8mrHVw1+yxGKcT3A+2r6abWf7gcl8JcQ8k2xkLQJJxosx5s3fd7nIHyR8FUMEzA2pu Ku3RU6v76ckz6o3h0c3+mO6XrAyB8Se/KNAwftfKWAbh6zZaoPl58P/p7L4rouP+cEaE p2i4FURCXDb4e5bXkmtVj6NzIylnWYJlQvE9PoWnkaa7rtqu0fvtLBoduhGVsmPIecCS cUMQ==
X-Gm-Message-State: AFq9FYKA5ecpXLATVowtFtakw1wEiiUMKsz7t2zwDQTDD8/LFXD1Q5v0 blnedfO2DOY71si9XA/XkKZYZfirpNtnrVdrN7/i4MVl4qtBva65/hGGkJlFfoD8UfAwcRKo13u ZZdk50TygEHnzBCGBuds/ARMHLwcQIVBPCAnTtdzy
X-Gm-Gg: AYBFou27eJfUpsqSRk4Br0++168JvpxetNi+rUy1qok+VKhkCVPvJNFLuZIij72r9tV qWLpD94NxRO2l2/5otDnRdtmfi9JJ0Pl0yShhp3vVhBhgqBikVDXx0JUSYoFRrv0EDKDn5kqj9E p777BYFeT62eq6r7YA1S5dVe3EPBgQpbfsnZc+OVPaeAE6Yggg9r+YR0aPIZRXE/DdWLmIwFA2x KCS1DrcbMgZlUzvPeD3gQKpiAIoJJP8PFpSjavjwXZLIs/BUESoc27OpGq2moYOQUip4bR+mhKF Q9HDPENwA3YPuLPMe+Sn5J9rXYJthHIbCQ3+uVv7GqDkZfqmTd3AbS87QxLWGOPE+3AOzLiStJe pimgzYBRhQ+Bg3VtEJc+n/2KmXLxQQxgU9gXnI2lNoEVnWS3EkbWgN095KrqlVDo9xbNIISF6Kr OZk5nMOkdGt2dA3Fwf1Uy+8FL2jLHfjBNGVZjnu0QXgSFXTQ==
X-Received: by 2002:a05:6402:c4c9:20b0:6b3:f094:8ced with SMTP id 4fb4d7f45d1cf-6b49cbeba4cmr3832415a12.21.1793300470375; Thu, 29 Oct 2026 12:01:10 -0700 (PDT)
MIME-Version: 1.0
References: <0d7134b0-c85e-4095-8cd6-4efcf65e5b49@gmail.com> <CABFYohgY2s93zAReZe4V+6Emmfzn10oJtFZ46C-G9QkAuoBgjQ@mail.gmail.com>
In-Reply-To: <CABFYohgY2s93zAReZe4V+6Emmfzn10oJtFZ46C-G9QkAuoBgjQ@mail.gmail.com>
From: Bryan Newbold <bryan@blueskyweb.xyz>
Date: Thu, 29 Oct 2026 12:00:58 -0700
X-Gm-Features: AclHuK9ra2js2QYOsoFd9IFcUxShMoaRA-SFg7oC54go2M6bKReihuj68pu4QgM
Message-ID: <CABFYohi6ZCY2mxBrYOQBtnoQ6-abuiBAxiEgAs5wGPq0JCqm7Q@mail.gmail.com>
To: Volker Mische <volker.mische@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000833d30065eff4d77"
X-Spamd-Bar: ---------------------------
Message-ID-Hash: MPQKHWUTD55D27QILISW575QK2GNL7MC
X-Message-ID-Hash: MPQKHWUTD55D27QILISW575QK2GNL7MC
X-MailFrom: bryan@blueskyweb.xyz
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: atp@ietf.org
X-Mailman-Version: 3.3.10
Precedence: list
Subject: [Atp] Re: Floats support summary
List-Id: Authenticated Transfer <atp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/atp/xs--fw9ZHHG2xZFsOFOmqxVrVV8>
List-Archive: <https://mailarchive.ietf.org/arch/browse/atp>
List-Help: <mailto:atp-request@ietf.org?subject=help>
List-Owner: <mailto:atp-owner@ietf.org>
List-Post: <mailto:atp@ietf.org>
List-Subscribe: <mailto:atp-join@ietf.org>
List-Unsubscribe: <mailto:atp-leave@ietf.org>

I've got a new proposal to consider for floats.

Credit for this goes to Daniel Holmgren, though Volker raised a similar
idea in a blog post back in May.

The basic idea is to flip things around and make `number` the core numeric
type. The semantics and JSON representation would match JSON numbers:
integer or floating point, in whatever formatting. JSON "123" and "123.0"
are both allowed, both describe the same number, and both get encoded the
same way in CBOR. The CBOR encoding would depend on the value of the number
itself: if it is whole number (integer), regardless of JSON formatting, it
gets represented as int64, otherwise it gets represented as floats. When
decoding CBOR, it would be mandatory to check that float values are not
whole numbers (integers), and throw an invalid data error if they are. How
numbers get represented in programming languages would be an SDK decision.
They could always be floats (like in JavaScript), or match the CBOR
encoding, or some other convention. What matters is consistency when
encoding and decoding CBOR.

The `integer` type would become a schema validation (lexicon) concept, and
represented in the data model as `number`. SDKs can use methods like
JavaScript's `Number.isInteger()` to check if a float is a whole number
(integer). Existing data records and deployed atproto software that works
with integers would continue to function just as it does today.

A nice property is that common small integer numbers (like "0" and "1")
would be represented more compactly than they would be as full float64.

If specified and implemented carefully, I think this would introduce floats
with an ergonomic developer experience, while meeting all the requirements
for the data model. Here are a few corner-cases to consider:

- whether `isInteger()` implementations exist and are perfectly consistent
across languages and machine architectures
- numbers beyond the "safe" 2^53 range where all integers can be
represented as a 64-bit float
- numbers beyond the 2^63 int64 range (do they encode as floats?)
- being able to losslessly represent any int64 *or* any float64 is a bit
weird
- other issues we have not thought of

I've also got a longer blog post about requirements for the atproto data
model and how to fit floats in:
https://bnewbold.leaflet.pub/3myzwz2tvgk26

--bryan


On Sun, Oct 25, 2026 at 6:41 PM Bryan Newbold <bryan@blueskyweb.xyz> wrote:

> Hi Volker,
>
> Thank you for picking this back up.
>
> I continue to have strong concerns about depending on JSON numeric
> encoding alone to determine whether a number is intended to be an integer
> or float. The JSON data model is clear in having only a single overall
> numeric type, and I think we need a more general and robust solution to
> this modeling problem than relying on observed implementation behaviors. In
> many situations and use-cases the encoding and distinction is not
> important, but because atproto is content-addressed, it is important. I
> think a wrapper encoding like the '$float' option you mention would be more
> suitable.
>
> In your analysis of implementation behaviors, you noted JavaScript and Go
> as language ecosystems where special care and configuration is required to
> ensure consistent encoding behavior. Those are both popular languages in
> general, and top languages in the atproto ecosystem today. As noted above I
> don't think the behaviors of individual JSON implementations are
> particularly important for making this decision, but it is concerning to me
> that these languages would not work reliably "out of the box".
>
> I'm putting together some more specific examples and a counter-proposal to
> share with the list. I'd love to get feedback on all this from more folks,
> both atproto developers and IETF community folks. The upcoming IETF 127
> meeting seems like a good time frame for converging on a path forward.
>
> --bryan
>
> On Fri, Oct 23, 2026 at 7:09 AM Volker Mische <volker.mische@gmail.com>
> wrote:
>
>> Hi all,
>>
>> the discussions about the floats calmed down over the past few months,
>> no new objections have been raised. Hence I've published a blog post [1]
>> which summarized the whole discussion and draws some conclusions. The
>> result is a straight forward change to the current repo draft spec [2].
>>
>> If you have any new insights or ideas that haven't been covered by the
>> summary, please share them prior to the IETF 127 meeting so that we can
>> use the time there to get it over the finish line. I'll attend remotely
>> and will be available for Q&A.
>>
>> [1]:
>>
>> https://vmx.cx/cgi-bin/blog/index.cgi/floats-on-atproto-summary%3A2026-10-23%3Aen%2CATProto
>> [2]: https://github.com/ietf-wg-atp/drafts/pull/35
>>
>> Cheers,
>>    Volker
>>
>> _______________________________________________
>> Atp mailing list -- atp@ietf.org
>> To unsubscribe send an email to atp-leave@ietf.org
>>
>