Skip to content

Support uint64 in EXPECT ... EPSILON - #7

Merged
Flakebi merged 1 commit into
GPUOpen-Tools:mainfrom
0z5a:expect-epsilon-uint64
Nov 19, 2026
Merged

Flakebi merged 1 commit into
GPUOpen-Tools:mainfrom
0z5a:expect-epsilon-uint64

Conversation

@0z5a

@0z5a 0z5a commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #6.

Value::compare_epsilon handles U32, U16, U8, F32 and F16, but not U64, so EXPECT <buf> uint64 EPSILON ... reached the panic!("Unsupported data type for epsilon comparison"). This adds a U64 arm written the same way as the other unsigned ones (absolute difference without underflow), and a run.sm case.

How I found it

I was reading the EXPECT path in src/main.rs. The parser builds an epsilon Value for every known data type, including uint64, but the match in compare_epsilon has no (U64, U64, U64) arm and ends in a panic!. Documentation.md lists uint64 as a data type and does not restrict EPSILON, so the two disagree. I then wrote a four-line script to confirm it.

Where this can show up in practice

  • A test that reads back 64-bit timestamps or counters (e.g. from a shader clock) and compares them with a tolerance: the runner panics instead of reporting pass or fail.
  • A suite of scripts run in CI: one such EXPECT aborts the process, so the scripts after it give no result.

This is my estimate; I have not seen a field report.

Testing

Trigger:

BUFFER buf DATA_TYPE uint64 SIZE 4 SERIES_FROM 10 INC_BY 1
EXPECT buf uint64 EPSILON 1 OFFSET 0 EQ 10 11 12 14
  • Before: panicked at src/main.rs:860:18: Unsupported data type for epsilon comparison. The same script with uint32 succeeds.
  • After: success. With EQ 10 11 12 15 it now fails with the normal ExpectEpsilon error showing the buffer contents, as uint32 does.
  • New EXPECT uint64 Epsilon case in src/tests/run.sm: panics without the main.rs change, passes with it.
  • cargo test --no-default-features (null backend) on macOS: 1 of 14 fails, "Compute Pipeline two Shaders". It fails the same way on unmodified main (1 of 13) on this machine, so it is unrelated.
  • rustfmt --check is clean.

Not run: the DX12 backend, Windows, or any GPU.

Value::compare_epsilon had no U64 arm, so an EXPECT with DATA_TYPE uint64
and an EPSILON panicked with "Unsupported data type for epsilon
comparison". Handle U64 like the other unsigned types and add a test.
@Flakebi

Flakebi commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Thanks, looks good!

@Flakebi
Flakebi merged commit 0c2c8bf into GPUOpen-Tools:main Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EXPECT with EPSILON panics for uint64 buffers

2 participants