Skip to content

[Subtyping Generator] Sync feature/subtype-gen branch with master#4339

Merged
SupunS merged 8 commits into
feature/subtype-genfrom
supun/sync-subtype-gen-with-master
Nov 14, 2025
Merged

[Subtyping Generator] Sync feature/subtype-gen branch with master#4339
SupunS merged 8 commits into
feature/subtype-genfrom
supun/sync-subtype-gen-with-master

Conversation

@SupunS

@SupunS SupunS commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

Sync with master to get the #4336 changes to the feature branch.

Conflicts:

Merge: cc0eee2de 589f8271c
Author: Supun Setunga <supun.setunga@gmail.com>
Date:   Thu Nov 13 21:57:37 2025 -0800

    Merge branch 'master' of https://github.com/onflow/cadence into supun/sync-subtype-gen-with-master

diff --git a/sema/type.go b/sema/type.go
remerge CONFLICT (content): Merge conflict in sema/type.go
index 174687738..382da51c3 100644
--- a/sema/type.go
+++ b/sema/type.go
@@ -7985,33 +7985,11 @@ func checkSubTypeWithoutEquality(subType Type, superType Type) bool {
 
                        if subTypeBaseType := typedSubType.BaseType(); subTypeBaseType != nil {
 
-<<<<<<< cc0eee2de (Merge pull request #4330 from onflow/supun/sync-subtype-gen-with-master)
                                if !IsSubType(subTypeBaseType, superTypeBaseType) {
                                        return false
                                }
 
                                return AreTypeArgumentsEqual(typedSubType, typedSuperType)
-=======
-                               if !IsSubType(subTypeBaseType, superTypeBaseType) {
-                                       return false
->>>>>>> 589f8271c (Merge pull request #4336 from onflow/supun/cache-authorization-conversion)
-                               }
-
-                               subTypeTypeArguments := typedSubType.TypeArguments()
-                               superTypeTypeArguments := typedSuperType.TypeArguments()
-
-                               if len(subTypeTypeArguments) != len(superTypeTypeArguments) {
-                                       return false
-                               }
-
-                               for i, superTypeTypeArgument := range superTypeTypeArguments {
-                                       subTypeTypeArgument := subTypeTypeArguments[i]
-                                       if !IsSubType(subTypeTypeArgument, superTypeTypeArgument) {
-                                               return false
-                                       }
-                               }
-
-                               return true
                        }
                } else {
                        // TODO: enforce type arguments, remove this rule
@@ -8026,15 +8004,9 @@ func checkSubTypeWithoutEquality(subType Type, superType Type) bool {
 
                return false
 
-<<<<<<< cc0eee2de (Merge pull request #4330 from onflow/supun/sync-subtype-gen-with-master)
-       // T<Us> <: V
-       // if T <: V
-       return IsParameterizedSubType(subType, superType)
-=======
        }
 
        return false
->>>>>>> 589f8271c (Merge pull request #4336 from onflow/supun/cache-authorization-conversion)
 }
 
 // UnwrapOptionalType returns the type if it is not an optional type,

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@SupunS SupunS self-assigned this Nov 14, 2025
@SupunS SupunS added the Chore label Nov 14, 2025
@github-actions

Copy link
Copy Markdown

Benchstat comparison

  • Base branch: onflow:feature/subtype-gen
  • Base commit: cc0eee2
Results

old.txtnew.txt
time/opdelta
pkg:github.com/onflow/cadence/bbq/compiler goos:linux goarch:amd64
CompileTime-433.5µs ± 0%32.4µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-4393µs ± 0%378µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ContractImport-4192µs ± 0%186µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-4257ns ± 0%254ns ± 0%~(p=1.000 n=1+1)
ExportType/simple_type-476.2ns ± 0%75.0ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
FTTransfer-4113µs ± 0%115µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-420.2µs ± 0%20.0µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ImperativeFib-413.7µs ± 0%13.3µs ± 0%~(p=1.000 n=1+1)
ImperativeFibNewCompilerNewVM-433.8µs ± 0%33.4µs ± 0%~(p=1.000 n=1+1)
ImperativeFibNewVM-416.2µs ± 0%15.8µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
InterpretRecursionFib-42.06ms ± 0%2.15ms ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
InterpreterFTTransfer-4111µs ± 0%113µs ± 0%~(p=1.000 n=1+1)
InterpreterImperativeFib-420.8µs ± 0%20.5µs ± 0%~(p=1.000 n=1+1)
InterpreterNewStruct-459.9µs ± 0%62.0µs ± 0%~(p=1.000 n=1+1)
MethodCall/concrete_type_method_call-429.2µs ± 0%29.2µs ± 0%~(p=1.000 n=1+1)
MethodCall/interface_method_call-450.2µs ± 0%49.6µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
NewInterpreter/new_interpreter-41.00µs ± 0%1.02µs ± 0%~(p=1.000 n=1+1)
NewInterpreter/new_sub-interpreter-4326ns ± 0%321ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
NewResource-486.3µs ± 0%84.6µs ± 0%~(p=1.000 n=1+1)
NewStruct-432.2µs ± 0%33.3µs ± 0%~(p=1.000 n=1+1)
NewStructRaw-43.47µs ± 0%3.78µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/sema goos:linux goarch:amd64
QualifiedIdentifierCreation/One_level-42.44ns ± 0%2.14ns ± 0%~(p=1.000 n=1+1)
QualifiedIdentifierCreation/Three_levels-479.4ns ± 0%80.7ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
RecursionFib-4826µs ± 0%799µs ± 0%~(p=1.000 n=1+1)
RuntimeFungibleTokenTransfer-4757µs ± 0%706µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-4564µs ± 0%582µs ± 0%~(p=1.000 n=1+1)
RuntimeFungibleTokenTransferVM-4615µs ± 0%597µs ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-42.61ms ± 0%2.48ms ± 0%~(p=1.000 n=1+1)
RuntimeResourceTracking-411.4ms ± 0%11.4ms ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-414.5µs ± 0%14.0µs ± 0%~(p=1.000 n=1+1)
RuntimeVMInvokeContractImperativeFib-427.5µs ± 0%26.5µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/sema goos:linux goarch:amd64
SuperTypeInference/arrays-4238ns ± 0%216ns ± 0%~(p=1.000 n=1+1)
SuperTypeInference/composites-492.6ns ± 0%88.8ns ± 0%~(p=1.000 n=1+1)
SuperTypeInference/integers-4298ns ± 0%300ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-468.0ns ± 0%66.9ns ± 0%~(p=1.000 n=1+1)
 
alloc/opdelta
pkg:github.com/onflow/cadence/bbq/compiler goos:linux goarch:amd64
CompileTime-416.3kB ± 0%16.3kB ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-4152kB ± 0%152kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ContractImport-473.6kB ± 0%73.5kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-4120B ± 0%120B ± 0%~(all equal)
ExportType/simple_type-40.00B 0.00B ~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
FTTransfer-438.2kB ± 0%38.4kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-48.30kB ± 0%8.30kB ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ImperativeFib-41.94kB ± 0%1.94kB ± 0%~(all equal)
ImperativeFibNewCompilerNewVM-421.8kB ± 0%21.8kB ± 0%~(p=1.000 n=1+1)
ImperativeFibNewVM-44.68kB ± 0%4.70kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
InterpretRecursionFib-41.19MB ± 0%1.19MB ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
InterpreterFTTransfer-439.9kB ± 0%39.9kB ± 0%~(p=1.000 n=1+1)
InterpreterImperativeFib-48.29kB ± 0%8.29kB ± 0%~(all equal)
InterpreterNewStruct-424.3kB ± 0%24.3kB ± 0%~(p=1.000 n=1+1)
MethodCall/concrete_type_method_call-47.00kB ± 0%7.00kB ± 0%~(p=1.000 n=1+1)
MethodCall/interface_method_call-414.4kB ± 0%14.5kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
NewInterpreter/new_interpreter-4976B ± 0%976B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-4232B ± 0%232B ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
NewResource-440.3kB ± 0%40.3kB ± 0%~(p=1.000 n=1+1)
NewStruct-410.3kB ± 0%10.4kB ± 0%~(p=1.000 n=1+1)
NewStructRaw-42.61kB ± 0%2.61kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/sema goos:linux goarch:amd64
QualifiedIdentifierCreation/One_level-40.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-464.0B ± 0%64.0B ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
RecursionFib-488.1kB ± 0%88.1kB ± 0%~(all equal)
RuntimeFungibleTokenTransfer-4238kB ± 0%237kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-4159kB ± 0%159kB ± 0%~(p=1.000 n=1+1)
RuntimeFungibleTokenTransferVM-4172kB ± 0%173kB ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-41.76MB ± 0%1.76MB ± 0%~(p=1.000 n=1+1)
RuntimeResourceTracking-49.27MB ± 0%9.27MB ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-48.03kB ± 0%8.02kB ± 0%~(p=1.000 n=1+1)
RuntimeVMInvokeContractImperativeFib-49.79kB ± 0%9.80kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/sema goos:linux goarch:amd64
SuperTypeInference/arrays-496.0B ± 0%96.0B ± 0%~(all equal)
SuperTypeInference/composites-40.00B 0.00B ~(all equal)
SuperTypeInference/integers-40.00B 0.00B ~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-448.0B ± 0%48.0B ± 0%~(all equal)
 
allocs/opdelta
pkg:github.com/onflow/cadence/bbq/compiler goos:linux goarch:amd64
CompileTime-4176 ± 0%176 ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-42.46k ± 0%2.46k ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ContractImport-4931 ± 0%931 ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-43.00 ± 0%3.00 ± 0%~(all equal)
ExportType/simple_type-40.00 0.00 ~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
FTTransfer-4978 ± 0%968 ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-4176 ± 0%176 ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ImperativeFib-449.0 ± 0%49.0 ± 0%~(all equal)
ImperativeFibNewCompilerNewVM-4205 ± 0%205 ± 0%~(all equal)
ImperativeFibNewVM-486.0 ± 0%86.0 ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
InterpretRecursionFib-417.7k ± 0%17.7k ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
InterpreterFTTransfer-4837 ± 0%833 ± 0%~(p=1.000 n=1+1)
InterpreterImperativeFib-4175 ± 0%175 ± 0%~(all equal)
InterpreterNewStruct-4418 ± 0%418 ± 0%~(all equal)
MethodCall/concrete_type_method_call-4135 ± 0%135 ± 0%~(all equal)
MethodCall/interface_method_call-4285 ± 0%285 ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
NewInterpreter/new_interpreter-415.0 ± 0%15.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-44.00 ± 0%4.00 ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
NewResource-4722 ± 0%722 ± 0%~(all equal)
NewStruct-4219 ± 0%219 ± 0%~(all equal)
NewStructRaw-438.0 ± 0%38.0 ± 0%~(all equal)
pkg:github.com/onflow/cadence/sema goos:linux goarch:amd64
QualifiedIdentifierCreation/One_level-40.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-42.00 ± 0%2.00 ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
RecursionFib-43.65k ± 0%3.65k ± 0%~(all equal)
RuntimeFungibleTokenTransfer-44.00k ± 0%3.98k ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-42.99k ± 0%2.98k ± 0%~(p=1.000 n=1+1)
RuntimeFungibleTokenTransferVM-43.01k ± 0%3.00k ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-436.7k ± 0%36.7k ± 0%~(all equal)
RuntimeResourceTracking-4159k ± 0%159k ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-4113 ± 0%113 ± 0%~(all equal)
RuntimeVMInvokeContractImperativeFib-4197 ± 0%197 ± 0%~(all equal)
pkg:github.com/onflow/cadence/sema goos:linux goarch:amd64
SuperTypeInference/arrays-43.00 ± 0%3.00 ± 0%~(all equal)
SuperTypeInference/composites-40.00 0.00 ~(all equal)
SuperTypeInference/integers-40.00 0.00 ~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-41.00 ± 0%1.00 ± 0%~(all equal)
 

@SupunS SupunS merged commit 3a91a73 into feature/subtype-gen Nov 14, 2025
10 of 12 checks passed
@SupunS SupunS deleted the supun/sync-subtype-gen-with-master branch November 14, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants