Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/xe_exec_system_allocator: Don't use NaN in an input buffer
@ 2026-05-04 15:28 Zbigniew Kempczyński
  2026-05-04 15:34 ` Matthew Brost
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Zbigniew Kempczyński @ 2026-05-04 15:28 UTC (permalink / raw)
  To: igt-dev; +Cc: Zbigniew Kempczyński, Francois Dugast

Setting input buffer memory to random byte (in this particular case
0xff) and then use it as a float causes doing compute square on NaN
numbers. It's nothing wrong about this but comparing NaN in between
returns false according to IEEE-754 rules. Buffer compare function
does assertion if output is not equal to expected output so we hit
this randomly in 'eu-fault*' tests.

Replace memset to loop which sets all input floats to real numbers
thus avoiding NaN arithmetic and comparison.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Francois Dugast <francois.dugast@intel.com>
---
 tests/intel/xe_exec_system_allocator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
index 5580099f78..0f1d6ee9c7 100644
--- a/tests/intel/xe_exec_system_allocator.c
+++ b/tests/intel/xe_exec_system_allocator.c
@@ -2339,7 +2339,8 @@ test_compute(int fd, struct drm_xe_engine_class_instance *eci, size_t size,
 		igt_assert(compute_input);
 		env.input_addr = to_user_pointer(compute_input);
 
-		memset(compute_input, rand() % 255 + 1, size);
+		for (int j = 0; j < env.array_size; j++)
+			compute_input[j] = rand() / (float)RAND_MAX;
 
 		xe_run_intel_compute_kernel_on_engine(fd, eci, &env, EXECENV_PREF_SYSTEM);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-05-06 10:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04 15:28 [PATCH i-g-t] tests/xe_exec_system_allocator: Don't use NaN in an input buffer Zbigniew Kempczyński
2026-05-04 15:34 ` Matthew Brost
2026-05-04 17:03   ` Zbigniew Kempczyński
2026-05-06  9:39     ` Francois Dugast
2026-05-06 10:38       ` Zbigniew Kempczyński
2026-05-04 18:52 ` ✓ i915.CI.BAT: success for " Patchwork
2026-05-04 19:29 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-05  0:29 ` ✓ Xe.CI.FULL: " Patchwork
2026-05-05  3:23 ` ✗ i915.CI.Full: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox