Skip to content

fix(detector): detect mappingproxy replay#134

Closed
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-165-mappingproxy-replay
Closed

fix(detector): detect mappingproxy replay#134
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-165-mappingproxy-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #165, where custom_kernel reads replay state through a MappingProxyType proxy while mutating the proxy's backing dict from the current input.

This adds a narrow MAPPINGPROXY_REPLAY detector. It requires:

  • a module-level dict backing store
  • a module-level MappingProxyType(backing) proxy
  • an entrypoint assignment to the backing dict from an input-derived call
  • an input-independent guard over the proxy
  • a call-free replay body returning a subscript of that same proxy

WeakKeyDictionary, OrderedDict, and unrelated mapping state stay out of scope.

KernelGuard-Red-Submission: 165

Local verification

  • red_46_mappingproxy_replay -> MAPPINGPROXY_REPLAY, should_filter=True
  • red_204_mappingproxy_tuple_key_replay -> MAPPINGPROXY_REPLAY, should_filter=True
  • red_37_weakkeydict_replay stayed valid
  • red_44_ordered_dict_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:04 — 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