Open Bug 1877150 Opened 1 year ago Updated 9 days ago

JS demo using BigInt calculates different values when using JS vs WebGPU (For Merkle depth 18 and above)

Categories

(Core :: Graphics: WebGPU, task, P3)

task

Tracking

()

REOPENED

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug, )

Details

Go to https://codesandbox.io/p/github/QEDProtocol/poseidon2-webgpu-demo/master
Let it load
Click on "Run benchmark"

AR: "cpu and gpu returned different merkle roots for the same input leaves!"
ER: Not so. Chrome doesnt show this error

If you check "Disable CPU (For large tree heights" button, then the answer is displayed. Based on this observation, I am putting this under JS, but please reclassify accordingly.

Summary: JS demo using BigInt calculated different values when using JS vs WebGPU → JS demo using BigInt calculates different values when using JS vs WebGPU
Severity: -- → N/A
Priority: -- → P3

I suspect this is actually just webgpu not quite being ready, but I'm also going to punt this over to WebGPU for them to look at.

Component: JavaScript Engine → Graphics: WebGPU

I get different results for this demo per platform. Will post them as separate messages.

On my M1 MacBook Pro with macOS 15.1.1 (24B91), I encounter no issues.

On my Windows 11 machine, I get a rather different error from the OP, as follows:

Uncaptured WebGPU error: Internal error: FXC D3DCompile error (Unspecified error (0x80004005)): C:\Program Files\Firefox Nightly\Shader@0x00000259C4713000(570,5-55): error X3017: cannot convert from 'const typedef uint2[4]' to 'uint2'

I've filed bug 1939742 to track this.

N.B. that the original link in this issue is no longer accessible, even with a CodeSandbox login. I've instead used the link in upstream at QEDProtocol/poseidon2-webgpu-demo: https://s684hf.csb.app/

Blocks: webgpu-apps
Depends on: 1939742
Severity: N/A → --

I can no longer reproduce this issue. Mayank, can you reproduce still?

Flags: needinfo?(mayankleoboy1)

Yes, this is WFM now.

Status: NEW → RESOLVED
Closed: 10 days ago
Flags: needinfo?(mayankleoboy1)
Resolution: --- → WORKSFORME

Actually, the error still occurs.

STR:
Go to https://s684hf.csb.app/
Unscheck/deselct "Random Leaves"
Set Merkle tree depth to 18
Click on Run benchmark.

AR: Error: cpu and gpu returned different merkle roots for the same input leaves!
ER: Not so.

I tested from level1 to level18.
Level1-Level17: Run fine
L18: Error.
So anything above 17 is bad. Incidentally, for anything above 17, the browser does some momentarily heavy work (memory copy or allocation) that freezes my whole machine. So maybe it is allocating a lot of memory and failing?

Status: RESOLVED → REOPENED
Flags: needinfo?(egubler)
Resolution: WORKSFORME → ---

There is an additional issue:
Once you repro the STR of comment #6 and get the error, reload the tab by clicking on the reload icon in the browser toolbar.

AR: Crash
https://crash-stats.mozilla.org/report/index/b8c409e6-6406-487b-807f-0a8550250304
https://crash-stats.mozilla.org/report/index/d58e77ee-c9d0-4036-a117-c29ac0250304

Edit: Spun off into bug 1951577

See Also: → 1951577
Summary: JS demo using BigInt calculates different values when using JS vs WebGPU → JS demo using BigInt calculates different values when using JS vs WebGPU (For Merkle depth 18 and above)
Flags: needinfo?(egubler)
You need to log in before you can comment on or make changes to this bug.