You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several places in the webapp multiply epoch milliseconds by 1,000,000 before converting to BigInt, which causes IEEE 754 precision loss (~256ns errors in ~0.2% of cases). The result exceeds Number.MAX_SAFE_INTEGER (~9e15) since epoch-ms * 1e6 is ~1.7e18.
The correct pattern is BigInt(ms) * BigInt(1_000_000) (multiplication after BigInt conversion). This already exists in convertDateToNanoseconds() in the same file - the buggy functions just didn't use it.
Impact: Low. The errors are +-256 nanoseconds, which is unlikely to cause visible issues. But it's an easy fix and prevents any edge cases with span ordering.
Context: Found during compute workload manager PR review (#3114). The supervisor's msToNano() was fixed in that PR using a split approach that also preserves sub-ms precision from performance.now() arithmetic.
Several places in the webapp multiply epoch milliseconds by 1,000,000 before converting to BigInt, which causes IEEE 754 precision loss (~256ns errors in ~0.2% of cases). The result exceeds
Number.MAX_SAFE_INTEGER(~9e15) since epoch-ms * 1e6 is ~1.7e18.The correct pattern is
BigInt(ms) * BigInt(1_000_000)(multiplication after BigInt conversion). This already exists inconvertDateToNanoseconds()in the same file - the buggy functions just didn't use it.Affected locations:
apps/webapp/app/v3/eventRepository/common.server.ts:24-getNowInNanoseconds()apps/webapp/app/v3/eventRepository/common.server.ts:38-calculateDurationFromStart()apps/webapp/app/v3/eventRepository/index.server.ts:217-recordRunDebugLog()apps/webapp/app/v3/runEngineHandlers.server.ts:431- retry event recordingImpact: Low. The errors are +-256 nanoseconds, which is unlikely to cause visible issues. But it's an easy fix and prevents any edge cases with span ordering.
Context: Found during compute workload manager PR review (#3114). The supervisor's
msToNano()was fixed in that PR using a split approach that also preserves sub-ms precision fromperformance.now()arithmetic.Linear: TRI-8269