Repository navigation
Preserve native Math identity and exact constants - #600
Open
CaelmBleidd wants to merge 2 commits into
Open
CaelmBleidd wants to merge 2 commits into
CaelmBleidd wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Module initializers and closures such as
export const DEG_TO_RAD = Math.PI / 180could stop before entering real class methods because the native Math global had no runtime object. Frontend local tables also include unbound global reads, which madeconst numeric = Mathread an uninitialized register instead of the native global.Load the SDK Math identity as an ordinary per-state object and initialize its eight readonly binary64 constants exactly once. Aliases share its identity and
typeofisobject. Genuine local, parameter, module, and import bindings retain priority. Native constant writes/deletes remain explicitly unsupported; this change does not add general property-descriptor semantics or approximate new Math APIs.Depends on #559 for SDK/runtime reference contracts. This PR contains only the additional native Math identity change and its source regressions.
Validation: 11 focused tests pass, zero failures or skips: 6 new source/native-oracle regressions plus all 5 existing builtin-owner boundary tests. Strict TS main/test detekt reports zero issues. On exact parent
d6e4629fc56279b7b6af57ca0b6703d131fe8f5c, the same module-initializer regression produces no analysis results; restoring the fix makes it pass. Full suites are left to CI. The real-corpus control and aggregate coverage impact will be checked on the combined experiment runtime.CI on runtime-fix head
4e433cbd8completed 1,781 TS tests with one failure and 138 skips: the existing missing-global prefix fixture still expected Math to be unsupported. All six new NativeMathIdentity tests passed. The test-only follow-up7935d7b4cswitches that negative fixture to the still-unmodeled JSON global and keeps every limitation-prefix assertion. No runtime code changed. This follow-up was not rerun locally while the frozen campaign held the shared lock; CI validates it.