Skip to content

gh-148285: Allow recording uops after specializing uops#148373

Open
adityakrmishra wants to merge 1 commit intopython:mainfrom
adityakrmishra:fix-uop-recording-v2
Open

gh-148285: Allow recording uops after specializing uops#148373
adityakrmishra wants to merge 1 commit intopython:mainfrom
adityakrmishra:fix-uop-recording-v2

Conversation

@adityakrmishra
Copy link
Copy Markdown

@adityakrmishra adityakrmishra commented Apr 11, 2026

The Issue:
Currently, analyzer.py forces any uop with records_value == True to be at index 0. This prevents Tier 2 recording uops from safely trailing Tier 1 specializing uops.

The Fix (V2):
Following feedback from @Sacul0457 on the previous PR, simply checking if the preceding uop was tier == 1 was too permissive (it allowed recording uops to follow any Tier 1 uop, not just specializing ones).

This updated patch uses a strict positional uop_index tracker in add_macro().
A recording uop is now only permitted if:

  1. It is at uop_index == 0 (the very first uop).
  2. OR it is at uop_index == 1 AND the preceding uop's name explicitly starts with _SPECIALIZE_.

CacheEffect (e.g., unused/1) and flush parts do not increment the uop_index, ensuring they remain completely transparent.

This strictly enforces the architecture while allowing structures like:
macro(X) = _SPECIALIZE_X + _RECORD_TOS_TYPE + unused/1 + _X;

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 11, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow recording uops after specializing uops

1 participant