Skip to content

spirv-opt: Fix assertion with fp8#6677

Open
GinShio wants to merge 1 commit into
KhronosGroup:mainfrom
GinShio:issue-6533
Open

spirv-opt: Fix assertion with fp8#6677
GinShio wants to merge 1 commit into
KhronosGroup:mainfrom
GinShio:issue-6533

Conversation

@GinShio

@GinShio GinShio commented May 6, 2026

Copy link
Copy Markdown
Contributor

This patch fixes an assertion crash in Debug build.

However, hex_float.h contains some errors when converting float32 to smaller floating point types, which causes incorrect results. Please see KhronosGroup/glslang#4241 for details.

fixes: #6533

@s-perron s-perron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I want to make sure we have a follow up issue referenced.

Comment thread test/opt/fold_test.cpp Outdated
Comment thread test/opt/fold_test.cpp Outdated
Comment on lines +1357 to +1359
// TODO: hex_float.h contains some errors when converting float32 to
// smaller floating point types, which causes incorrect results. Please see
// https://github.com/KhronosGroup/glslang/issues/4241 for details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add TODO comment, And remove FIXME

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, 0x1.4p0 is 1.25 in dec... I confused 0x1.4p0 -> 1.4...
Using 0x1.7p0 presents this issue.

This patch fixes an assertion crash in Debug build.

However, hex_float.h contains some errors when converting float32 to
smaller floating point types, which causes incorrect results. Please see
KhronosGroup/glslang#4241 for details.

fixes: KhronosGroup#6533
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.

assert(width...) should take into account fp8 types in GetWordsFromScalarFloatConstant

2 participants