Skip to content

Conversation

@izaitsevfb
Copy link
Contributor

@izaitsevfb izaitsevfb commented Sep 29, 2025

  1. Fixed commits-without-jobs issue
  • Problem: Commits with no workflow jobs (e.g., periodic workflow) were excluded from signal extraction
  • Solution:
    • Added fetch_commits_in_time_range() to query push table directly
    • Modified job query to filter by explicit list of head_shas instead of JOIN
    • Changed ORDER BY to use sha dimension first (preserves grouping, actual order doesn't matter as internally extractors now iterate over the list of commits passed explicitly)
  1. Added mandatory timestamp field to SignalCommit
  • Changes:
    • SignalCommit.init(head_sha, timestamp, events) - timestamp is now mandatory
    • Signal extraction populates timestamps from push table
    • HUD state logger uses commit timestamp instead of computing from event times
    • Updated 36 test constructor calls

Testing

Before:

2025-09-29T19-29-47.670686-00-00.html

After:
2025-09-29T21-38-10.190584-00-00.html

@pytorch-bot pytorch-bot bot added the ci-no-td label Sep 29, 2025
@vercel
Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Updated (UTC)
torchci Ignored Ignored Sep 29, 2025 9:54pm

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 29, 2025
@jeanschmidt jeanschmidt merged commit 53c6bdf into main Sep 30, 2025
6 checks passed
@jeanschmidt jeanschmidt deleted the autorevert-include-gaps-in-the-signal branch September 30, 2025 12:57
jeanschmidt pushed a commit that referenced this pull request Oct 1, 2025
Testing on the periodic workflow (on top of
#7248):

```
 python -m pytorch_auto_revert  autorevert-checker periodic --hours 128 --bisection-limit 2   --hud-html
 python -m pytorch_auto_revert --dry-run autorevert-checker periodic --hours 256 --bisection-limit 2   --hud-html
```


[2025-09-29T22-00-27.941916-00-00.html](https://github.com/user-attachments/files/22607006/2025-09-29T22-00-27.941916-00-00.html)


[2025-09-29T22-03-58.012711-00-00.html](https://github.com/user-attachments/files/22607013/2025-09-29T22-03-58.012711-00-00.html)




----


 Algorithm:

- Goal: Cover the “unknown” span between failure and success partitions
by scheduling at most N new restarts, sampling widely via iterative
bisection.
- Intuition: Always split the largest unknown gap; choose its midpoint;
repeat until the budget is exhausted.

  Inputs/Output

  - Input covered: boolean list over the unknown region
- True = already covered/separator (e.g., pending), False = uncovered
candidate.
  - Input limit: optional int; total target coverage for this run.
      - Budget allowed = max(0, limit − sum(covered)); None = unlimited.
- Output: boolean list of equal length; True marks indices to newly
cover (schedule now).

  Procedure

  - If limit is None: return NOT covered (select all uncovered).
  - Else:
- Build contiguous uncovered gaps (sequences of False) separated by True
entries.
- Push each gap into a max-heap keyed by (-length, lo, hi) using Gap(lo,
hi):
          - length = hi − lo + 1
          - heap_key = (-length, lo, hi) for deterministic tie-breaking.
      - While allowed > 0 and heap not empty:
- Pop largest gap g; pick mid = floor((g.lo + g.hi)/2); select mid;
allowed -= 1.
- Push back sub-gaps [g.lo, mid-1] and [mid+1, g.hi] if non-empty.
      - Return the selection mask.

  Properties

  - Deterministic ties (equal-length gaps) prefer lower lo.
- Already-covered (pending) entries both reduce the budget and split
gaps, pacing new work naturally.
  - If limit ≤ current_covered → allowed = 0 → no new selections.
- Complexity: O(A log G), where A = number of picks (≤ allowed), G =
initial number of gaps.

  Integration in signal processing

  - PartitionedCommits.cover_gap_unknown_commits:
- Builds covered mask for the unknown partition: pending=True
(separator), missing=False (candidate).
- Calls the planner; maps selected indices back to commit SHAs to
restart.
  - process_valid_autorevert_pattern(bisection_limit=...):
- Applies gap-cover selections, then independently applies
failure-/success-side restarts based on infra and threshold heuristics.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants