Skip to content

t_compile: mutation-kill tests for the shader disk cache - #138

Open
pablogonz12 wants to merge 2 commits into
mainfrom
lane/b100-80
Open

pablogonz12 wants to merge 2 commits into
mainfrom
lane/b100-80

Conversation

@pablogonz12

@pablogonz12 pablogonz12 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Adds test_cache_mutations to vk/tests/t_compile.c. 28 hand-applied mutations of the cache code in mali_compile.c: 24 killed; 4 survivors are equivalent or unobservable (bounds checks before fread, vs_layout_size redundant with hashed data, stage field needs the same SPIR-V valid under two stages). check.sh passes. No VkPipelineCache file exists (CreatePipelines ignores the cache).

Summary by CodeRabbit

  • Tests
    • Expanded validation of shader-cache behavior, including cache selection, handling of invalid or oversized entries, and cleanup after failed operations. Added checks for scenarios where compilation or input validation prevents caching, as well as cache bypass behavior. These checks help verify that cache results and statistics remain consistent across configuration and failure cases.

…precedence, entry validation, stats, failed stores)
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The compile tests now cover shader cache key separation, cache hits and stores, malformed entries, failed operations, cache-directory selection, and cache bypass conditions.

Changes: Shader cache mutation tests

Layer / File(s) Summary
Cache keys and statistics
vk/tests/t_compile.c
Tests check separate entries for distinct shader modules, compile options, and linked fragment-shader layouts. They also check cache hit, miss, and store statistics.
Entry validation and failed operations
vk/tests/t_compile.c
Tests check recovery from malformed or oversized entries, failed stores, invalid shader compilation, and rejected architectures.
Cache selection and bypass
vk/tests/t_compile.c
Tests check cache-directory precedence and empty-value behavior, MALI_OPT_GCM bypass, environment restoration, temporary-file cleanup, and invocation from main.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related PRs

  • pgm1207/mali-open#44: Changes shader disk-cache key separation and entry checks, which are covered by the new mutation tests.
Merge Risk: Minimal · up to 08cf3

This PR adds tests for the shader disk cache and does not change runtime behavior. No merge-blocking risk was identified.

Security architecture risk: Minimal · up to 08cf3

This change adds shader-cache regression tests without changing production cache behavior. No introduced architecture-level security, ownership, or failure-containment risk was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "t_compile: mutation-kill tests for the shader disk cache" matches the main change. The PR adds test_cache_mutations to vk/tests/t_compile.c, which covers shader disk cache key separation, h…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "t_compile: mutation-kill tests for the shader disk cache" matches the main change. The PR adds test_cache_mutations to vk/tests/t_compile.c, which covers shader disk cache key separation, hit/store statistics, entry validation, cache-directory precedence, and failed-store behavior. The title is specific and does not use vague terms. It names the test file's scope and the shader disk cache, which are the core of the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 1
  • Waived: $0.25 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6e87480 and 08cf3a9.

Files selected for processing: 1

  • vk/tests/t_compile.c

Limit details: You’ve used all 10 included reviews currently available.

Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 20, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 20, 2026
Merge main into the cache-test lane, preserving both its current logic-op/XFB tests and the original mutation tests and call sites. Match the current .tmpPID.SEQ cache temporary names in both cleanup assertions so leftover files cannot be missed.

The actual filename helper passed 18 controlled cases, with the old matcher failing the negative control. Lint and progress checks pass. Full compiler execution requires the pinned Mesa build and is delegated to exact-head CI.

Copy link
Copy Markdown
Owner Author

@codex review

Conflict repair published at 4e4347d. Main's logic-op/XFB cache tests and calls are preserved, alongside this PR's original 244-line mutation block and its call. Only vk/tests/t_compile.c differs from main.

The review also found that the two old cleanup assertions could not see current .tmpPID.SEQ cache files. They now match the actual format. The actual count_files helper passed 18 controlled filename cases; the old matcher missed all three representative leftovers and the correction detected them.

private-lint, skill-lint, progress check and diff checks pass. The published tree 9117074ee2425741f8ddee3965216112c1f1e8f2 matches the local tree. Full compiler execution was unavailable locally because third_party/build-vk is absent, so the fresh CI result is required before merge. No phone or driver implementation changed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 4e4347d52f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant