fix: console.log implicit pointers#2398
Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (350 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.93, 1.90, 3.98, 6.12, 7.06, 10.66, 21.14, 23.58]
line [0.94, 1.82, 4.18, 6.09, 7.25, 10.44, 19.59, 22.85]
line [0.88, 1.87, 3.88, 6.13, 7.39, 9.82, 20.20, 23.63]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.30, 0.59, 0.72, 0.82, 1.09, 1.19, 1.46, 1.57]
line [0.31, 0.56, 0.72, 0.85, 1.16, 1.19, 1.44, 1.58]
line [0.30, 0.53, 0.73, 0.81, 1.08, 1.14, 1.36, 1.51]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.91, 1.99, 4.01, 6.13, 12.60, 26.46, 55.50, 113.58]
line [0.83, 1.97, 3.82, 5.91, 12.54, 25.63, 52.30, 107.54]
line [0.82, 2.17, 4.25, 6.72, 12.12, 25.43, 53.84, 110.84]
|
There was a problem hiding this comment.
Pull request overview
Fixes TGSL console.log codegen when logging implicit pointer values (e.g. myUniform.$) by ensuring logged arguments are converted to their underlying value types before serializer generation.
Changes:
- Add a regression test covering
console.logwith an implicit pointer from a uniform. - Update the console log generator to convert arguments using
unptr(...)before building the logging function + metadata. - Extend
unptr(...)typing to acceptUnknownDatain more call sites.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/typegpu/tests/tgsl/consoleLog.test.ts | Adds an inline-snapshot test proving implicit pointers are dereferenced for logging. |
| packages/typegpu/src/tgsl/consoleLog/logGenerator.ts | Converts/dereferences arguments prior to serializer generation and adjusts metadata derivation. |
| packages/typegpu/src/data/dataTypes.ts | Broadens unptr(...) overloads to support UnknownData at the type level. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cieplypolar
left a comment
There was a problem hiding this comment.
Good catch 💜 . Left some nits.
Co-authored-by: Szymon Szulc <103948576+cieplypolar@users.noreply.github.com>
No description provided.