Skip to content

fix(detector): detect enum index replay - #131

Closed
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-236-enum-index-replay
Closed

prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-236-enum-index-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #236, where custom_kernel stores the first input-derived result in a module-level state slot indexed by an IntEnum member, then returns that same enum-indexed slot from an input-independent fast path.

This adds a narrow ENUM_INDEX_REPLAY detector. It requires:

  • a local Enum or IntEnum class
  • module-level list or dict state
  • an entrypoint assignment to an enum-indexed subscript of that state from an input-derived call
  • an input-independent guard reading an enum-indexed subscript
  • a call-free replay body returning an enum-indexed subscript of the same state

Array-derived indexes, slice-object indexes, and enum member values that are themselves containers stay out of scope.

KernelGuard-Red-Submission: 236

Local verification

  • red_111_enum_index_replay -> ENUM_INDEX_REPLAY, should_filter=True
  • red_38_array_index_replay stayed valid
  • red_131_slice_object_index_replay stayed valid
  • red_219_enum_value_list_replay stayed valid
  • red_499_enum_member_list_replay stayed valid
  • clean fixtures in eval_blue_patch.py stayed valid
  • uv run python -m py_compile kernelguard.py

@prasannakotyal
prasannakotyal temporarily deployed to kernelguard-api-control-plane May 2, 2026 00:00 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

KernelGuard Blue Evaluation

@SinatrasC

Copy link
Copy Markdown
Collaborator

Thanks for the KernelGuard Flywheel Campaign contribution. We are not merging this narrow variant separately because the consolidated rule-family implementation in #273 is the merge path for this detector area.

@SinatrasC SinatrasC closed this Jun 20, 2026

This branch was previously deployed

1 inactive deployment
kernelguard-api-control-plane — 0f7ce3c7 Deployed May 2, 2026 by prasannakotyal via sync #202
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.

2 participants