Repository navigation
tooling: add a translator corpus hash check and an IR dump option - #3791
Conversation
|
The reviewed head passed Windows and Linux CI, but GitHub reports a merge conflict against current main. Please rebase |
2568a0d to
13625d2
Compare
R0Y00
left a comment
There was a problem hiding this comment.
Thanks for the rebase. I confirmed the MSVC warning suppression still surrounds the legacy environment lookup and the explicit dump path is reserved alongside the output paths. On Windows Debug at 13625d24, the eight tests selected by ctest --preset dev --no-tests=error -j 2 -R '^(native_translator_corpus_(dxil|ir)|native_compile_dxil_(refusals|rekey|watch)|native_direct_mesh|native_rtv_variant_controls|startup_compute_translate_requests)$' --output-on-failure passed.
Problem
There is no single check that says whether a change to the native translator alters its output. Refactors, build-flag changes and cache changes each have to argue "no output change" from individual fixtures.
Change
tests/translator_corpus_hash.pyrunscompile_dxilover a source-built corpus (graphics pairs, RTV variants, compute requests, raw mesh shaders) and writes a sorted TSV: one row per request with its status and either a SHA-256 fingerprint of the published DXIL or the refusal reason. Running the same script and DXC directory against two builds and diffing the TSVs compares their output.compile_dxil --dump-irwrites the exact text handed to the compiler beside each stage asOUTPUT.cso.ir. The corpus script accepts--irto fingerprint that text instead.native_translator_corpus_dxilandnative_translator_corpus_ir, check known compilations and refusals and compare two cold snapshots byte for byte. The IR test also compares DXIL from runs with and without the dump option.docs/experiments/translator-corpus.mdhas the base-to-head procedure.Possible follow-up: a
translator-corpusjob inwindows.ymlthat buildscompile_dxilfor the PR head and its merge base and requires identical TSVs.Validation
Windows, MSVC,
devpreset, at2568a0d59: 8/8 tests passed.Comparing two builds:
Fixtures are generated from the synthetic instruction words already in the repository's tests.