Skip to content

fix(detector): detect builtins attribute replay#147

Closed
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-185-builtins-attr-replay
Closed

fix(detector): detect builtins attribute replay#147
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-185-builtins-attr-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #185, where custom_kernel stores the first input-derived output on a dynamically named builtins attribute, then returns that same attribute from an input-independent fast path.

This adds a narrow BUILTINS_ATTR_REPLAY detector. It requires:

  • an entrypoint setattr(builtins, name, <input-derived call>) mutation
  • an input-independent guard over the same builtins attribute, including hasattr(...)
  • a replay body containing only getattr(builtins, name) access
  • return of that same builtins attribute

Builtins exec/eval dictionary access and other dynamic execution variants stay out of scope.

KernelGuard-Red-Submission: 185

Local verification

  • red_69_builtins_attr_replay -> BUILTINS_ATTR_REPLAY, should_filter=True
  • red_228_builtins_dict_exec_define stayed valid
  • red_229_getattr_builtins_exec_define stayed valid
  • red_253_vars_builtins_exec_define 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 04:36 — 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
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