demo · v136

AI streaming progress

The chromestatus link in the spec PR explicitly cites the WebMachineLearning Writing Assistance APIs — AI model downloads where the API wants to expose progress as a fraction (0..1) without inventing a synthetic total. With loaded and total typed as double, the event can carry {loaded: 0.42, total: 1} directly.

Probing ProgressEvent constructor accepts double…
0%
event.loaded (double)
event.total (double)
event.lengthComputable
last reported fraction

the code

// Old (unsigned long long):
//   loaded must be an integer; AI APIs were forced into fake byte counters.
// 136+ (double):
const ev = new ProgressEvent("progress", { loaded: 0.42, total: 1, lengthComputable: true });
// Now loaded/total can be a clean 0..1 fraction. The Writing Assistance APIs
// (https://github.com/webmachinelearning/writing-assistance-apis/issues/15)
// drove this change.

why this angle

The sibling concept demonstrates the byte-overflow case (the integer cap at 4GB). This concept demonstrates the other side of the same change: fractional progress, where total = 1 and loaded ramps from 0 to 1. That signal is unrepresentable with integers without scaling tricks (which collide with byte counters for real downloads).

see also