Skip to content

[perf pipeline] Perf_BigInteger.ModPow failing with System.ArgumentException: Destination is too short. (Parameter 'destination') #2575

Closed
dotnet/runtime
#74585

Description

@radical

Log from runtime-wasm-perf run on dotnet/runtime#74097:

// **************************
// Benchmark: Perf_BigInteger.ModPow: Job-BJXMHI(PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0) [arguments=1024,1024,64 bits]
// *** Execute ***
// Launch: 1 / 1
// Execute: /home/helixbot/.jsvu/v8 --expose_wasm test-main.js -- --run 95a3fee8-6d92-4c8b-8059-369b73cd756f.dll --benchmarkName "System.Numerics.Tests.Perf_BigInteger.ModPow(arguments: 1024,1024,64 bits)" --job "PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0" --benchmarkId 67  in /datadisks/disk1/work/A6C10953/w/B67009A6/e/performance/artifacts/bin/for-running/MicroBenchmarks/95a3fee8-6d92-4c8b-8059-369b73cd756f/bin/net7.0/browser-wasm/AppBundle
Failed to set up high priority. Make sure you have the right permissions. Message: Permission denied
Incoming arguments: --run 95a3fee8-6d92-4c8b-8059-369b73cd756f.dll --benchmarkName System.Numerics.Tests.Perf_BigInteger.ModPow(arguments: 1024,1024,64 bits) --job PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0 --benchmarkId 67
Application arguments: --run 95a3fee8-6d92-4c8b-8059-369b73cd756f.dll --benchmarkName System.Numerics.Tests.Perf_BigInteger.ModPow(arguments: 1024,1024,64 bits) --job PowerPlanMode=00000000-0000-0000-0000-000000000000, Runtime=Wasm, Toolchain=Wasm, InvocationCount=1, IterationCount=1, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0 --benchmarkId 67
console.debug: mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
console.info: Initializing.....
// BeforeAnythingElse

// Benchmark Process Environment Information:
// Runtime=.NET Core (Mono) 8.0.0-ci, Wasm NativeAOT
// GC=Non-concurrent Workstation
// HardwareIntrinsics=
// Job: Job-WFMUPX(PowerPlanMode=00000000-0000-0000-0000-000000000000, InvocationCount=1, IterationCount=1, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=0)

// BeforeActualRun

...

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: Destination is too short. (Parameter 'destination')
   at System.Numerics.BigIntegerCalculator.PowCore(Span`1 , Int32 , ReadOnlySpan`1 , ReadOnlySpan`1 , Span`1 , Span`1 )
   at System.Numerics.BigIntegerCalculator.Pow(ReadOnlySpan`1 , ReadOnlySpan`1 , ReadOnlySpan`1 , Span`1 )
   at System.Numerics.BigInteger.ModPow(BigInteger , BigInteger , BigInteger )
   at System.Numerics.Tests.Perf_BigInteger.ModPow(BigIntegers arguments)
   at BenchmarkDotNet.Autogenerated.Runnable_67.WorkloadActionUnroll(Int64 invokeCount)
   at BenchmarkDotNet.Engines.Engine.RunIteration(IterationData data)
   at BenchmarkDotNet.Engines.EngineStage.RunIteration(IterationMode mode, IterationStage stage, Int32 index, Int64 invokeCount, Int32 unrollFactor)
   at BenchmarkDotNet.Engines.EngineActualStage.RunSpecific(Int64 invokeCount, IterationMode iterationMode, Int32 iterationCount, Int32 unrollFactor)
   at BenchmarkDotNet.Engines.EngineActualStage.Run(Int64 invokeCount, IterationMode iterationMode, Boolean runAuto, Int32 unrollFactor, Boolean forceSpecific)
   at BenchmarkDotNet.Engines.EngineActualStage.RunWorkload(Int64 invokeCount, Int32 unrollFactor, Boolean forceSpecific)
   at BenchmarkDotNet.Engines.Engine.Run()
   at BenchmarkDotNet.Autogenerated.Runnable_67.Run(IHost host, String benchmarkName)
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
   --- End of inner exception stack trace ---
   at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at BenchmarkDotNet.Autogenerated.UniqueProgramName.AfterAssemblyLoadingAttached(String[] args)
// AfterAll
{"name":"ExitStatus","message":"Program terminated with exit(-1)","status":-1}
No Workload Results were obtained from the run.
// Benchmark Process 4941 has exited with code 255.

This is reproducible on main, with interpreter.

cc @adamsitnik @LoopedBard3 @lewing

Activity

  1. added
    pipeline blocker
    on Aug 24, 2022
  2. adamsitnik commented on Aug 25, 2022

    @adamsitnik
    Member

    It's also reproducible with CLR. Repro:

    py .\scripts\benchmarks_ci.py -f net7.0 --filter System.Numerics.Tests.Perf_BigInteger.ModPow
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
     ---> System.ArgumentException: Destination is too short. (Parameter 'destination')
       at System.Numerics.BigIntegerCalculator.PowCore(Span`1 value, Int32 valueLength, ReadOnlySpan`1 power, ReadOnlySpan`1 modulus, Span`1 temp, Span`1 bits)
       at System.Numerics.BigIntegerCalculator.Pow(ReadOnlySpan`1 value, ReadOnlySpan`1 power, ReadOnlySpan`1 modulus, Span`1 bits)
       at System.Numerics.BigInteger.ModPow(BigInteger value, BigInteger exponent, BigInteger modulus)
       at System.Numerics.Tests.Perf_BigInteger.ModPow(BigIntegers arguments) in D:\projects\performance\src\benchmarks\micro\libraries\System.Runtime.Numerics\Perf.BigInteger.cs:line 101
       at BenchmarkDotNet.Autogenerated.Runnable_0.WorkloadActionNoUnroll(Int64 invokeCount) in D:\projects\performance\artifacts\bin\MicroBenchmarks\Release\net7.0\faa7e6d1-41e0-4e3d-8e1e-9d83759c269a\faa7e6d1-41e0-4e3d-8e1e-9d83759c269a.notcs:line 329
       at BenchmarkDotNet.Engines.Engine.RunIteration(IterationData data)
       at BenchmarkDotNet.Engines.EngineFactory.Jit(Engine engine, Int32 jitIndex, Int32 invokeCount, Int32 unrollFactor)
       at BenchmarkDotNet.Engines.EngineFactory.CreateReadyToRun(EngineParameters engineParameters)
       at BenchmarkDotNet.Autogenerated.Runnable_0.Run(IHost host, String benchmarkName) in D:\projects\performance\artifacts\bin\MicroBenchmarks\Release\net7.0\faa7e6d1-41e0-4e3d-8e1e-9d83759c269a\faa7e6d1-41e0-4e3d-8e1e-9d83759c269a.notcs:line 179
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
       at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
       --- End of inner exception stack trace ---
       at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
       at BenchmarkDotNet.Autogenerated.UniqueProgramName.AfterAssemblyLoadingAttached(String[] args) in D:\projects\performance\artifacts\bin\MicroBenchmarks\Release\net7.0\faa7e6d1-41e0-4e3d-8e1e-9d83759c269a\faa7e6d1-41e0-4e3d-8e1e-9d83759c269a.notcs:line 58
    // AfterAll
    

    @dakersnar @tannergooding Has a recent change in dotnet/runtime introduced a product bug or exposed a benchmark bug?

  3. tannergooding commented on Aug 25, 2022

    @tannergooding
    Member

    Looks like a product bug, investigating. Most likely caused by dotnet/runtime#74112

  4. adamsitnik commented on Aug 26, 2022

    @adamsitnik
    Member

    Closed by #2578

  5. radical commented on Sep 6, 2022

    @radical
    MemberAuthor

    This doesn't seem to have been fixed by dotnet/runtime#74585. #2590 re-enables the benchmark, but gets the same error.
    cc @tannergooding

  6. reopened this on Sep 6, 2022
  7. dakersnar commented on Sep 6, 2022

    @dakersnar
    Contributor

    Looking into this right now.

  8. tannergooding commented on Sep 6, 2022

    @tannergooding
    Member

    I'd expect we're just not on the right build. A regression test for the exact value the perf test fails on was added.

  9. dakersnar commented on Sep 6, 2022

    @dakersnar
    Contributor

    It looks like dotnet/installer is still pointing to https://github.com/dotnet/runtime/tree/ef077d0b58ffddcf54fa73bd85dace6b999b8992, which is 3 days before the ModPow fix was merged into main. This should be resolved once dotnet/installer points to an updated dotnet/runtime.

  10. adamsitnik commented on Oct 5, 2022

    @adamsitnik
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pipeline blocker

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions