Skip to content

DU Option<Option<RecordOfIntInt64>> #153

Open
@IgorErin

Description

@IgorErin

Describe the bug

Failed All tests.Execution tests.Tests on composite types on gfx90c.Union tests.Simple test on `Option<Option<RecordOfIntInt64>>` [49 ms]
  Error Message:

Failed after 1 test. Parameters:
        [|Some (Some { X = 0
               Y = 0L }); Some (Some { X = 0
                                       Y = 0L })|]
Shrunk 2 times to:
        [|None|]
Result:
        Exception
  System.ArgumentException: Incorrect instance type (Parameter 'obj')
   at Microsoft.FSharp.Quotations.PatternsModule.checkObj(MemberInfo membInfo, FSharpExpr obj) in D:\a\_work\1\s\src\FSharp.Core\quotations.fs:line 1019
   at Microsoft.FSharp.Quotations.PatternsModule.mkInstancePropGet(FSharpExpr obj, PropertyInfo pinfo, FSharpList`1 args) in D:\a\_work\1\s\src\FSharp.Core\quotations.fs:line 1267
   at Microsoft.FSharp.Quotations.ExprShapeModule.RebuildShapeCombination(Object shape, FSharpList`1 arguments) in D:\a\_work\1\s\src\FSharp.Core\quotations.fs:line 3047
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 14
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 14
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 14
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 14
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf@16.Invoke(FSharpExpr expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList`1 cons, FSharpFunc`2 f, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 238
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in D:\a\_work\1\s\src\FSharp.Core\local.fs:line 247
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 16
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 14
   at Brahma.FSharp.OpenCL.Translator.QuotationTransformers.PrintfReplacer.replacePrintf(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\QuotationTransformers\Prin
tfTransformer.fs:line 14
   at Brahma.FSharp.OpenCL.Translator.FSQuotationToOpenCLTranslator.transformQuotation(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\Translator.fs:line 89
   at Brahma.FSharp.OpenCL.Translator.FSQuotationToOpenCLTranslator.translate(FSharpExpr expr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\Translator.fs:line 102
   at <StartupCode$Brahma-FSharp-OpenCL-Translator>[email protected](Unit unitVar0) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\Translator.fs:line 143
   at Brahma.FSharp.OpenCL.Translator.FSQuotationToOpenCLTranslator.Translate(FSharpExpr qExpr) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Translator\Translator.fs:line 143
   at Brahma.FSharp.ClProgram`2..ctor(ClContext ctx, FSharpExpr`1 srcLambda) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Core\ClProgram.fs:line 22
   at [email protected](RuntimeContext _arg1) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Core\ClTask.fs:line 148
   at [email protected](RuntimeContext env)
   at [email protected](RuntimeContext env)
   at CompositeTypesTests.Helpers.Pipe #1 input at line [email protected](RuntimeContext env)
   at <StartupCode$Brahma-FSharp-OpenCL-Core>[email protected](RuntimeContext env)
   at <StartupCode$Brahma-FSharp-OpenCL-Core>[email protected](RuntimeContext env) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Core\ClTask.fs:line 54
   at CompositeTypesTests.Helpers.Pipe #1 input at line [email protected](RuntimeContext env)
   at CompositeTypesTests.Helpers.Pipe #1 input at line [email protected](RuntimeContext env)
   at Brahma.FSharp.ClTask.runSync[a](RuntimeContext context, ClTask`1 _arg1) in C:\Projects\Brahma.FSharp\src\Brahma.FSharp.OpenCL.Core\ClTask.fs:line 92
   at CompositeTypesTests.Helpers.check[a](RuntimeContext context, a[] data, FSharpFunc`2 command) in C:\Projects\Brahma.FSharp\tests\Brahma.FSharp.Tests\ExecutionTests\CompositeTypesTests.fs:line
14
   at [email protected](FSharpOption`1[] data) in C:\Projects\Brahma.FSharp\tests\Brahma.FSharp.Tests\ExecutionTests\CompositeTypesTests.fs:line 324
   at FsCheck.Testable.evaluate[a,b](FSharpFunc`2 body, a a)
Focus on error:
        etestProperty (306613076, 297204988) "Simple test on `Option<Option<RecordOfIntInt64>>`"

To Reproduce
run test.

[<Struct>]
type RecordOfIntInt64 = { X: int; Y: int64 }

testProperty (message "Option<Option<RecordOfIntInt64>>")
      <| fun (data: Option<Option<RecordOfIntInt64>>[]) ->
          if data.Length <> 0 then
              check data
              <| fun length ->
                  <@
                      fun (range: Range1D) (buffer: ClArray<_>) ->
                          let gid = range.GlobalID0

                          if gid < length then
                              buffer.[gid] <-
                                  match buffer.[gid] with
                                  | Some (Some { X = x; Y = y }) -> Some (Some { X = x; Y = y })
                                  | Some None -> Some None
                                  | None -> None

                  @>

Desktop (please complete the following information):

  • OS: Win 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions