Files
Vettickal Sen, Anuraj 4a9af35bf4 Bitexactness CRC verification and per-test JSON output (#320)
* Bitexactness CRC verification and per-test JSON output

* Remove redundant BLIS_TEST_SEED random seed utilities

The random_seed_utils.h and BLIS_TEST_SEED environment variable are unnecessary since the codebase already ensures deterministic random number generation via RANDOM_POOL_SEED and SRAND_SEED constants hardcoded in testing_helpers.h.

* Add CRC support for integer/char computediff and cache env var checks

Add CRC calculation and binary output to the gtint_t and char specializations of computediff, matching the pattern used by all other overloads. Char values are widened to gtint_t for safe uint32_t-aligned CRC access.

Cache BLIS_ENABLE_CRC and BLIS_ENABLE_BINARY_OUTPUT env var lookups via static const bool in is_crc_enabled() and is_binary_output_enabled(). Guard all CRC/binary blocks in computediff with is_any_verification_enabled() so the common disabled path is a single static bool read with zero allocations.

* Address PR review comments and refactor computediff CRC blocks

Refactor: Extract duplicated CRC/binary-output blocks from all 8 computediff overloads into verify_vector_data and verify_matrix_data helpers in blis_test_utils namespace.

Bug fixes from PR review: add missing includes (cstdlib, utility), enforce MAX_OUTPUT_SIZE_BYTES limit with integer overflow guard, add buffer validation in all CRC generation functions, add default case to FLA_GET_DATATYPE_FACTOR macro, replace deprecated test_case_name() with test_suite_name(), add MAKE_DIRECTORY error checking in CMake, and update copyright years to 2026.

* Refactored crc_utils based on review comments.

* binary_output_utils.h cleanup.

* Address PR review comments: remove unused functions and fix copyright years.

Remove unused generate_crc_matrix, generate_crc_matrix_no_nb_diag,
generate_crc_matrix_no_nb_diag_with_storage, and
calculate_and_print_matrix_crc from crc_utils.h.
Remove unused calculate_and_print_matrix_hash from check_error.h.
Fix copyright year to 2026 only in crc_utils.h and binary_output_utils.h.
Remove (Performance) label from CRC heading in README.md.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix for review comments.

* Address review comments: rename verify to collect, consistent void returns, remove filename prefix

- Rename verify_vector_data/verify_matrix_data to collect_vector_data/
  collect_matrix_data since these functions only collect CRC and binary
  output data without performing comparison.
- Make return types consistent: change calculate_and_print_crc,
  calculate_and_print_matrix_crc_with_storage, format_and_record_crc,
  and write_comparison_outputs to return void since return values were
  never used.
- Remove redundant test_output_ prefix from generate_binary_filename
  to avoid duplication with the blis_test_outputs/ directory.
- Remove unused utility include from binary_output_utils.h.
- Update README wording from compiled out to disabled.

Made-with: Cursor

* Fix strict aliasing, use if constexpr, zero-pad CRC hex, separate feature guards

- Replace reinterpret_cast<uint32_t*> with memcpy-based read_uint32()
  helper to avoid strict-aliasing UB on float/double/complex buffers.
  Produces identical CRC values.
- Use if constexpr(CRC_ENABLED) instead of runtime if(!CRC_ENABLED) to
  prevent CRC template instantiation when ENABLE_CRC is off.
- Zero-pad CRC hex output to 8 digits for stable downstream comparison.
- Separate ENABLE_CRC and ENABLE_BINARY_OUTPUT preprocessor guards in
  verification_utils.h so each feature is compiled independently.

Made-with: Cursor

* Handle write_binary_output return values in write_comparison_outputs

Capture the bool return values from write_binary_output and, on failure, log a warning to stdout and record the error as a GTest property. This keeps binary output as a non-fatal diagnostic aid while ensuring return values are explicitly used.

Made-with: Cursor

---------

Co-authored-by: Anuraj <avettick@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-03-13 15:12:17 +05:30
..
2026-01-23 17:23:52 +00:00