mesa/src/amd/compiler/tests
Rhys Perry 6e06012825 radv,ac: make rembrandt and vangogh cache compatible
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41340>
2026-05-06 17:41:31 +00:00
..
check_output.py aco/tests: fix skip_lines=True with remaining characters in matches 2025-01-08 15:28:37 +00:00
framework.h amd: remove unnecessary and transitive #includes 2026-04-24 21:53:07 +00:00
glsl_scraper.py meson: remove --depfile for aco_tests 2024-05-30 09:44:52 +00:00
helpers.cpp radv,ac: make rembrandt and vangogh cache compatible 2026-05-06 17:41:31 +00:00
helpers.h amd: remove unnecessary and transitive #includes 2026-04-24 21:53:07 +00:00
main.cpp aco/tests: don't assume constructor order 2024-04-16 15:46:19 +00:00
meson.build amd: add meson variable idep_amd_generated_headers for all generated headers 2026-02-28 05:23:59 +00:00
README.md
test_assembler.cpp aco/gfx11.7: fix v_pk_min_f16/v_pk_max_f16 opcode numbers 2026-05-04 11:11:52 +00:00
test_builder.cpp aco/tests: Fix p_startpgm definitions to registers 2025-08-01 17:15:54 +00:00
test_d3d11_derivs.cpp aco/tests: update ACO tests for ac_nir_lower_tex_coords refactoring 2026-05-01 02:37:16 +00:00
test_hard_clause.cpp amd: remove unnecessary and transitive #includes 2026-04-24 21:53:07 +00:00
test_insert_nops.cpp aco/tests: test VALUMaskWriteHazard with v_cmpx 2026-01-12 15:48:39 +00:00
test_insert_waitcnt.cpp amd: rename most GFX115x definitions for released chips 2025-12-03 13:29:07 +00:00
test_isel.cpp aco: remove remaining occurences of block_kind_continue 2026-04-10 08:51:39 +00:00
test_lower_branches.cpp aco/tests: add lower_branches tests 2025-06-19 10:58:39 +00:00
test_lower_subdword.cpp aco/tests: Fix p_startpgm definitions to registers 2025-08-01 17:15:54 +00:00
test_optimizer.cpp aco/tests: fix med3 NaN tests 2026-04-12 17:10:28 +00:00
test_optimizer_postRA.cpp aco: allow v_cmpx with DPP 2026-01-27 20:42:51 +00:00
test_reduce_assign.cpp aco: use lv1/lv2 instead of v1/v2.as_linear() 2026-01-28 16:46:30 +00:00
test_regalloc.cpp aco: move return address to a clobbered register 2026-02-06 09:49:19 +00:00
test_scheduler.cpp aco/sched_vopd: create dot2acc from VOP3P dot2 2026-03-10 14:21:56 +00:00
test_sdwa.cpp aco/optimizer: remove can_apply_extract 2025-10-14 08:33:42 +00:00
test_tests.cpp aco: use SPDX-License-Identifier 2024-04-08 15:49:25 +00:00
test_to_hw_instr.cpp aco: use lv1/lv2 instead of v1/v2.as_linear() 2026-01-28 16:46:30 +00:00

Tests are wrapped in a BEGIN_TEST/END_TEST and write data to the output file pointer. Tests have checks against the output. They are single line comments prefixed with certain characters:

  • ! fails the test if the current line does not match the pattern
  • >> skips to the first line which matches the pattern, or fails the test if there is none
  • ; executes python code to extend the pattern syntax by inserting functions into the variable dictionary, fail the test, insert more checks or consume characters from the output

Before this prefix, there can be a ~ to only perform the check for certain variants (a regex directly following the ~ is used).

Pattern Syntax

Patterns can define variables which can be accessed in both python code and the pattern itself. These are useful for readability or dealing with unstable identifiers in the output. Variable identifiers are sequences of digits, ascii letters or _ (though they cannot start with a digit).

  • \ can be used to match the following literal character without interpreting it.
  • Most characters expect the same characters in the output.
  • A sequence of spaces in the pattern expects a sequence of spaces or tabs in the output.
  • A # in the pattern expects an unsigned integer in the output. The # can be followed by an identifier to store the integer in a variable.
  • A $ in the pattern stores the output until the first whitespace character into a variable.
  • A % in the pattern followed by an identifier is the same as a # but it expects a % before the integer in the output. It basically matches a ACO temporary.
  • A @ calls a variable as a function. It can be followed by an argument string wrapped in ( and ).

Functions

  • s64, s96, s128, v2, v3, etc, expand to a pattern which matches a disassembled instruction's definition or operand. It later checks that the size and alignment is what's expected.
  • match_func expands to a sequence of $ and inserts functions with expand to the extracted output
  • search_re consumes the rest of the line and fails the test if the pattern is not found