Uncaught Error: argument bit ratio not found
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
首先,使用 setGraphical(true) 运行提供的 GPU.js 浏览器复现,然后将其与非图形情况进行比较。检查 FunctionBuilder.assignArgumentBitRatio,并单独调查空返回示例;完成的标准是所报告的两个案例都不再抛出所描述的错误。
由索引模型根据 Issue 内容生成。
描述
What is wrong?
Adding certain custom functions causes the error: Uncaught Error: argument bit ratio not found
Where does it happen?
Not system specific
How do we replicate the issue?
<script>
const gpu = new GPU()
gpu.addFunction(function f(x, y) {
return y[0]
})
const test = gpu.createKernel(function (a) {
f(1, a)
}).setOutput([4, 4]).setGraphical(true)
test([0])
</script>
Setting setGraphical(true) causes the error for some reason
How important is this (1-5)?
3 or 4 maybe?
Expected behavior (i.e. solution)
No error
Other Comments
In FunctionBuilder.assignArgumentBitRatio, replacing calleeNode.argumentBitRatios[i] with calleeNode.argumentBitRatios[argumentIndex] should fix the problem.
Also, why does having a blank return statement cause an error
const test = gpu.createKernel(function () {
// stuff
return
}).setOutput([4, 4]).setGraphical(true)
test() // Uncaught Error: Unexpected return statement on ...
when there is no error with having no return statements
const test = gpu.createKernel(function () {
// stuff
}).setOutput([4, 4]).setGraphical(true)
test()
- 主要语言
- JavaScript
- 星标
- 15.5k
- 派生
- 663
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gpujs/gpu.js 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
-
WebGL backend silently returns all zeros for long-running kernels (no GL error, no context loss)未关闭
难度 5/5 一周以上 新手友好度 42/100
-
难度 5/5 一周以上 新手友好度 20/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
refactor
难度 2/5 半天 新手友好度 84/100
维护者通常 5 天内回复
-
translation
难度 2/5 1-3 小时 新手友好度 78/100
ciderapp/translations#87 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
component: split-view platform: windows
难度 2/5 1-3 小时 新手友好度 74/100
zen-browser/desktop#15616 · 1 个 reaction ·
维护者通常 1 天内回复