Description
We recently started using Isolate.number
s from the VM Service as the threadId
s in the debug adapter. It turned out that these numbers were random 64bit numbers and could easily be values that aren't precisely representable in languages that use 64bit floating point numbers.
This was fixed via #53081 by reducing these numbers to 53bits.
However, with some more digging it's not clear that 53bit integers are allowed in DAP either. The spec says:
integers defined in the protocol (JSON schema type
integer
) may be represented as 32 bit signed integers, although some properties disallow negative values. numbers in the protocol (JSON schema typenumber
) may be represented as 64 bit floating point numbers.
Although the online spec has threadId
as number
, the JSON spec uses integer
.
Assuming the correct type is integer
, this means we cannot use > 32bits for threadIds
. This would mean either:
- The VM Service IDs need reducing further from 53bit to 32bit integers
- We should stop using the
Isolate.number
directly asthreadId
and instead add a custom API for mapping back and forth
@bkonyi @jacob314 thoughts/opinions?
(cc @elliette @christopherfujino)
Related: