[Fix] (trace-replay): support alternate golden images

- compare actual output against primary and alternate golden images

- record the matched golden path in trace replay results

- allow APK and Linux retrace fixtures to pass alternate golden paths

- keep nostalgia validation accepting both Mesa and PC goldens
This commit is contained in:
2026-06-20 19:04:52 +08:00
parent e92a57011f
commit a1e2007b82
9 changed files with 167 additions and 30 deletions
+5
View File
@@ -22,6 +22,10 @@ endif()
if(NOT DEFINED TRACE_FUZZ_PERCENT OR "${TRACE_FUZZ_PERCENT}" STREQUAL "")
set(TRACE_FUZZ_PERCENT 20)
endif()
set(alternate_golden_args)
if(DEFINED TRACE_ALTERNATE_GOLDEN AND NOT "${TRACE_ALTERNATE_GOLDEN}" STREQUAL "")
list(APPEND alternate_golden_args --alternate-golden "${TRACE_ALTERNATE_GOLDEN}")
endif()
if(EXISTS "${TRACE_OUTPUT_DIR}")
file(REMOVE_RECURSE "${TRACE_OUTPUT_DIR}")
@@ -50,6 +54,7 @@ execute_process(
COMMAND "${TRACE_REPLAY_EXE}"
--trace "${trace_path}"
--golden "${TRACE_GOLDEN}"
${alternate_golden_args}
--diff "${TRACE_OUTPUT_DIR}/output/${TRACE_CASE_NAME}-diff.png"
--output "${TRACE_OUTPUT_DIR}/output"
--backend "${TRACE_BACKEND}"