Valid HLSL fails validation with "No indefinite logarithm/arcsine/arccosine/derivative" when an overflowing constant reaches log/asin/acos/ddx
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by running the three HLSL examples with the listed DXC commands and compare them with the inline-infinity cases that compile. Trace constant folding and DXIL emission for log, asin, acos, and ddx/ddy, then check how the validator handles infinite immediate operands. Done means the reported shaders compile successfully or produce a source-level diagnostic instead of a validator error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When constant folding turns a float expression into +/-infinity and the result feeds
log, asin, acos or ddx/ddy, DXC emits the DXIL op with an infinite immediate
operand. DXC's own validator then rejects it (Instr.NoIndefiniteLog, NoIndefiniteAsin,
NoIndefiniteAcos, NoIndefiniteDsxy), so compilation fails with error: validation errors.
I believe the source is valid HLSL: log(+inf) is +inf, and asin/acos/ddx of inf have
well-defined (NaN) results. Thus I believe the compiler should either fold the call or keep the
operand out of the immediate position.
Steps to Reproduce
log_inf.hlsl:
RWStructuredBuffer<float> output : register(u0);
[numthreads(1, 1, 1)]
void main() {
float big = 3.0e38f;
output[0] = log(big * 10.0f);
}
dxc -T cs_6_0 -E main log_inf.hlsl
acos_asin_inf.hlsl:
RWStructuredBuffer<float> output : register(u0);
[numthreads(1, 1, 1)]
void main() {
float big = 3.0e38f;
output[0] = acos(big * 10.0f) + asin(big * 10.0f);
}
dxc -T cs_6_0 -E main acos_asin_inf.hlsl
ddx_inf.hlsl:
float4 main() : SV_Target {
float big = 3.0e38f;
return ddx(big * 10.0f);
}
dxc -T ps_6_0 -E main ddx_inf.hlsl
Actual Behavior
error: validation errors
log_inf.hlsl:6:15: error: No indefinite logarithm.
note: at '%2 = call float @dx.op.unary.f32(i32 23, float 0x7FF0000000000000)' in block '#0' of function 'main'.
Validation failed.
(and No indefinite arccosine. / No indefinite arcsine. / No indefinite derivative calculation.
for the other two files).
Interestingly log(3.0e38f * 10.0f) written inline, and log(1.0f / 0.0f), both compile,
so it depends on where the infinity is produced.
Expected Behavior
The shaders compile (e.g. by folding log(inf) to inf, or not emitting an immediate
infinite operand), or at least fail with a source-level diagnostic rather than a
validator error.
Environment
- DXC version: reproduces on
main(c3a85328, 1.10.0.10001, built with assertions),
release v1.9.2609 (1.9.2609.5 (01b62ad47)) and v1.9.2602 (1.9.2602.17 (21d28f727)) - Host operating system: Windows Server 2025 (x64)
- Ngôn ngữ chính
- C++
- Star
- 3.7k
- Fork
- 926
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 45
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/DirectXShaderCompiler
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/DirectXShaderCompiler#9173 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
microsoft/DirectXShaderCompiler#9155 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/DirectXShaderCompiler#9135 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
DXC emits DW_LANG_C_plus_plus instead of DW_LANG_HLSL for HLSLCó thể đã có người làm @rj123-nv đã nhận 18 ngày trước. Đang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/DirectXShaderCompiler#9087 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/DirectXShaderCompiler#9086 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/DirectXShaderCompiler
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
feature:config kind:docs os:windows toolchain:cmake triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
arch-based bug niri
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
noctalia-dev/noctalia#5552 ·
Maintainer thường phản hồi trong vòng 1 ngày