Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESMeta] PRs & Discussions about ESMeta #3486

Open
kimjg1119 opened this issue Nov 20, 2024 · 0 comments
Open

[ESMeta] PRs & Discussions about ESMeta #3486

kimjg1119 opened this issue Nov 20, 2024 · 0 comments

Comments

@kimjg1119
Copy link
Contributor

kimjg1119 commented Nov 20, 2024

ESMeta has been upgraded to version v0.5.0, adding support for advanced type analysis. However, it still produces some false alarms, primarily due to missing assertions, among other factors.

NOTE: v0.5.0 is merged in #3487!

As we agreed, too many algorithms are listed in esmeta-ignore.json. We aim to find solutions to these alarms, discuss some more challenging cases, and organize issues/PRs to keep track. This might lead to a higher volume of PRs, so I apologize in advance if it seems spammy.

Please reply to this issue if you have a problem or question with ESMeta alarms or an upgrade;
We will keep updating this doc on which alarms remain and which can be resolved with a fix.

Resolved PR

#PR Name Ignore diff
#2924 Fixed return types of algorithms returning empty -4
#3485 Editorial: Add an assertion for PrivateEnvironment cannot be null -1

Open PRs

#PR Name
#3445 Editorial: GlobalObject cannot be undefined in the GetGlobalObject
#3466 Editorial: Narrowing an assertion in SuperCall: super Arguments
#3483 Editorial: Add an Assertion for Built-in Function Object
#3484 Editorial: GetModuleNamespace cannot return empty
#3488 Editorial: Handle non-direct binding cases in ResolveExports
#3494 Editorial: use suspended-start instead of undefined in AsyncGeneratorState
#3495 Editorial: Allocate-and-use in MakeMatchIndicesIndexPairArray for refinement
#3496 Editorial: ProxyTarget is always a function object in GetFunctionRealm

Open Issues

#Issue Name
#3117 Atomics.{add,sub} call TypedArrayElementType before validating the input is actually a TypedArray

Remaining Ignores & Breakdown

May resolved in Open PRs

We already opened related PR and are waiting for the response.

List

#2924

[ReturnTypeMismatch] Block[13050] return statement in LabelledStatement[0,0].LabelledEvaluation (step 5, 7:12-34)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[ESValue | Enum[~empty~]] | Break | Continue | Return | Throw

[ReturnTypeMismatch] Block[13052] return statement in LabelledItem[1,0].LabelledEvaluation (step 1, 2:12-57)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[Enum[~empty~]]

[ReturnTypeMismatch] Block[13054] return statement in Statement[0,0].LabelledEvaluation (step 1, 2:12-47)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[ESValue | Enum[~empty~]] | Break | Continue | Return | Throw

[ReturnTypeMismatch] Block[13056] return statement in Statement[1,0].LabelledEvaluation (step 1, 2:12-47)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[Enum[~empty~]]

[ReturnTypeMismatch] Block[13058] return statement in Statement[2,0].LabelledEvaluation (step 1, 2:12-47)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[Enum[~empty~]]

[ReturnTypeMismatch] Block[13111] return statement in Catch[0,0].CatchClauseEvaluation (step 9, 13:12-25)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[ESValue | Enum[~empty~]] | Break | Continue | Return | Throw

[ReturnTypeMismatch] Block[13113] return statement in Catch[1,0].CatchClauseEvaluation (step 1, 2:12-43)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[ESValue | Enum[~empty~]] | Break | Continue | Return | Throw

[ReturnTypeMismatch] Block[13285] return statement in FunctionBody[0,0].EvaluateFunctionBody (step 2, 3:12-59)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[ESValue | Enum[~empty~]] | Break | Continue | Return | Throw

[ReturnTypeMismatch] Block[14086] return statement in ClassStaticBlockBody[0,0].EvaluateClassStaticBlockBody (step 3, 4:12-67)
- expected: Normal[ESValue] | Abrupt
- actual  : Normal[ESValue | Enum[~empty~]] | Break | Continue | Return | Throw

#3379

[ParamTypeMismatch] Call[13626] argument assignment to second parameter _kind_ when Call[13626] function call from YieldExpression[2,0].Evaluation (step 4, 5:38-75) to GetIterator
- expected: Enum[~async~, ~sync~]
- actual  : Enum[~async~, ~non-generator~, ~sync~]

#3445

[ReturnTypeMismatch] Block[5611] return statement in GetGlobalObject (step 2, 3:12-51)
- expected: Record[Object]
- actual  : Record[Object] | Undefined

#3466

[ParamTypeMismatch] Call[8955] argument assignment to third parameter _newTarget_ when Call[8955] function call from SuperCall[0,0].Evaluation (step 6, 7:32-73) to Construct
- expected: Record[Constructor]
- actual  : Record[Object]

#3483

[ReturnTypeMismatch] Block[6404] return statement in Record[BuiltinFunctionObject].Construct (step 1, 2:12-96)
- expected: Normal[Record[Object]] | Throw
- actual  : Normal[ESValue] | Throw

#3484

[ReturnTypeMismatch] Block[7133] return statement in Record[ModuleNamespaceExoticObject].Get (step 9.a, 12:16-58)
- expected: Normal[ESValue] | Throw
- actual  : Normal[Record[ModuleNamespaceExoticObject] | Enum[~empty~]]

[ParamTypeMismatch] Call[15912] argument assignment to third parameter _V_ when Call[15912] function call from Record[SourceTextModuleRecord].InitializeEnvironment (step 7.b.iii, 17:30-86) to Record[DeclarativeEnvironmentRecord].InitializeBinding
- expected: ESValue
- actual  : Record[ModuleNamespaceExoticObject] | Enum[~empty~]

[ParamTypeMismatch] Call[15925] argument assignment to third parameter _V_ when Call[15925] function call from Record[SourceTextModuleRecord].InitializeEnvironment (step 7.c.iii.3, 24:32-88) to Record[DeclarativeEnvironmentRecord].InitializeBinding
- expected: ESValue
- actual  : Record[ModuleNamespaceExoticObject] | Enum[~empty~]

#3485

[ParamTypeMismatch] Call[9993] argument assignment to first parameter _privateEnv_ when Call[9993] function call from RelationalExpression[7,0].Evaluation (step 6, 7:33-92) to ResolvePrivateIdentifier
- expected: Record[PrivateEnvironmentRecord]
- actual  : Record[PrivateEnvironmentRecord] | Null

#3488

[ParamTypeMismatch] Call[15858] argument assignment to second parameter _exportName_ when Call[15858] function call from Record[SourceTextModuleRecord].ResolveExport (step 6.a.iv.2, 22:29-93) to Record[SourceTextModuleRecord].ResolveExport
- expected: String
- actual  : Enum[~all-but-default~] | String | Null

#3494

[ParamTypeMismatch] Call[34431] argument assignment to first parameter _generator_ when Call[34431] function call from CreateAsyncIteratorFromClosure (step 13, 14:22-65) to AsyncGeneratorStart
- expected: Record[AsyncGenerator]
- actual  : Record[AsyncGenerator | Generator]

[ReturnTypeMismatch] Block[34432] return statement in CreateAsyncIteratorFromClosure (step 15, 16:14-33)
- expected: Record[AsyncGenerator]
- actual  : Record[AsyncGenerator | Generator]

#3495

[ParamTypeMismatch] Call[23910] argument assignment to second parameter _P_ when Call[23910] function call from MakeMatchIndicesIndexPairArray (step 9.e.iv, 23:28-86) to CreateDataPropertyOrThrow
- expected: Record[Symbol] | String
- actual  : String | Undefined

#3496

[ParamTypeMismatch] Call[2325] argument assignment to first parameter _obj_ when Call[2325] function call from GetFunctionRealm (step 3.c, 10:23-54) to GetFunctionRealm
- expected: Record[FunctionObject]
- actual  : Record[Object]

I cannot make a PR because of a lack of understanding; thus, I'll leave these as Issues now. These are with #3117 .

[ParamTypeMismatch] Call[31314] argument assignment to first parameter _O_ when Call[31314] function call from INTRINSICS.Atomics.add (step 1, 2:26-61) to TypedArrayElementType
- expected: Record[TypedArray]
- actual  : ESValue

[ParamTypeMismatch] Call[31538] argument assignment to first parameter _O_ when Call[31538] function call from INTRINSICS.Atomics.sub (step 1, 2:26-61) to TypedArrayElementType
- expected: Record[TypedArray]
- actual  : ESValue

Planning to PR

We finished writing PRs, and there is none left!

Cannot resolve now

We are actively working to resolve the issues; however, some cases are particularly challenging and require more time. To keep readers informed, we have compiled a list of errors that cannot be resolved at this moment.

Planning to resolve In Future update

We hope the alarms below will be resolved in several weeks.

Details

[ParamTypeMismatch] Call[7014] argument assignment to second parameter _byteIndex_ when Call[7014] function call from TypedArrayGetElement (step 6, 7:21-123) to GetValueFromBuffer
- expected: NonNegInt
- actual  : Int
[ParamTypeMismatch] Call[7036] argument assignment to second parameter _byteIndex_ when Call[7036] function call from TypedArraySetElement (step 3.e, 9:24-136) to SetValueInBuffer
- expected: NonNegInt
- actual  : Int
[ParamTypeMismatch] Call[31197] argument assignment to first parameter _O_ when Call[31197] function call from DoWait (step 20.c, 28:26-87) to CreateDataPropertyOrThrow
- expected: Record[Object]
- actual  : Record[Object] | Undefined

[ParamTypeMismatch] Call[31199] argument assignment to first parameter _O_ when Call[31199] function call from DoWait (step 20.d, 29:26-93) to CreateDataPropertyOrThrow
- expected: Record[Object]
- actual  : Record[Object] | Undefined

[ParamTypeMismatch] Call[31208] argument assignment to first parameter _O_ when Call[31208] function call from DoWait (step 21.c, 34:26-87) to CreateDataPropertyOrThrow
- expected: Record[Object]
- actual  : Record[Object] | Undefined

[ParamTypeMismatch] Call[31210] argument assignment to first parameter _O_ when Call[31210] function call from DoWait (step 21.d, 35:26-93) to CreateDataPropertyOrThrow
- expected: Record[Object]
- actual  : Record[Object] | Undefined
[ParamTypeMismatch] Call[34361] argument assignment to first parameter _generator_ when Call[34361] function call from AsyncGeneratorYield (step 9, 10:22-101) to AsyncGeneratorCompleteStep
- expected: Record[AsyncGenerator]
- actual  : Record[AsyncGenerator | Generator]
[ParamTypeMismatch] Call[18152] argument assignment to first parameter _O_ when Call[18152] function call from InstallErrorCause (step 1.a, 3:33-58) to Get
- expected: Record[Object]
- actual  : ESValue

Others

Unfortunately, we do not have an idea of how to resolve the errors below right now.

Details

[ReturnTypeMismatch] Block[6066] return statement in Record[ECMAScriptFunctionObject].Call (step 9, 14:12-36)
- expected: Normal[ESValue] | Throw
- actual  : Break | Continue | Throw

[ReturnTypeMismatch] Block[6168] return statement in Record[ECMAScriptFunctionObject].Construct (step 11.a, 22:14-38)
- expected: Normal[Record[Object]] | Throw
- actual  : Break | Continue | Throw
[ReturnTypeMismatch] Block[6977] return statement in TypedArrayLength (step 9, 10:14-74)
- expected: NonNegInt
- actual  : Int
[BinaryOpTypeMismatch] Branch[28227] binary operation (<) in CompareTypedArrayElements (step 6, 10:17-26)
- left    : Number | BigInt
- right   : Number | BigInt

[BinaryOpTypeMismatch] Branch[28230] binary operation (<) in CompareTypedArrayElements (step 7, 11:17-26)
- left    : Number | BigInt
- right   : Number | BigInt
[ReturnTypeMismatch] Block[30561] return statement in GetViewByteLength (step 8, 9:14-49)
- expected: NonNegInt
- actual  : Int
[BinaryOpTypeMismatch] Branch[31192] binary operation (==) in DoWait (step 20, 25:17-26)
- left    : Number[Int] | BigInt
- right   : Number | BigInt
[ParamTypeMismatch] Call[31601] argument assignment to first parameter _block_ when Call[31601] function call from INTRINSICS.Atomics.notify (step 7, 11:24-67) to GetWaiterList
- expected: Record[SharedDataBlock]
- actual  : Record[DataBlock | SharedDataBlock] | Null
[ReturnTypeMismatch] Block[32987] return statement in AsyncFromSyncIteratorContinuation (step 3, 4:14-64)
- expected: Record[Promise]
- actual  : Throw

[ReturnTypeMismatch] Block[32998] return statement in AsyncFromSyncIteratorContinuation (step 5, 6:14-65)
- expected: Record[Promise]
- actual  : Throw

[ReturnTypeMismatch] Block[33009] return statement in AsyncFromSyncIteratorContinuation (step 7, 8:14-72)
- expected: Record[Promise]
- actual  : Throw

[ReturnTypeMismatch] Block[15976] return statement in Record[SourceTextModuleRecord].ExecuteModule (step 9.f.i, 17:20-38)
- expected: Normal[Enum[~unused~]] | Throw
- actual  : Break | Continue | Return | Throw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant