[Masonry] dense-packing: include open end of tracks when finding eligible track opening [chromium/src : main]

0 views
Skip to first unread message

Celeste Pan (Gerrit)

unread,
Dec 12, 2025, 6:18:41 PM (3 days ago) Dec 12
to Javier Fernandez, AyeAye, Ian Kilpatrick, Kurt Catti-Schmidt, Alison Maher, Yanling Wang, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Alison Maher, Ian Kilpatrick and Kurt Catti-Schmidt

Celeste Pan added 12 comments

Patchset-level comments
File-level comment, Patchset 25 (Latest):
Celeste Pan . resolved

Rebased + restructured our usage of `track_collection_openings_.` `running_positions_` has been removed. There may be minor changes after the rebase that cause breaks, but I was hoping to get feedback on the actually changed parts.

Commit Message
Line 7, Patchset 13:[Masonry] dense-packing: include open tracks when finding track opening
Alison Maher . resolved

nit: empty

Celeste Pan

Personally I don't love the use of "empty" because the track isn't necessarily fully empty, it's more like the track has an open end which would align with the track opening we're building.

If we have a track opening which spans 30px to 50px, the "open track" we build into maybe has one item which goes until 25px, but we can still lay out a multi-span item into the open track. There's a good example of this that I added in masonry_running_positions.h!

I used an in-between here of "open ending of tracks", let me know if you feel like that gives enough clairty!

Line 12, Patchset 14:open tracks.
Alison Maher . resolved

nit: maybe "new empty"?

Celeste Pan

Done

Line 14, Patchset 14:This change builds track openings across open tracks as needed in order
Alison Maher . resolved

Same here, and other references to "open" below, since that could be confused with other kinds of "openings"

Celeste Pan

Done

Line 17, Patchset 14:To account for open tracks: 1) in
Alison Maher . resolved

nit: I'd add a new line before this to make it clear all of these list items are related to "To account for open tracks"

Celeste Pan

The current version of this has a newline!

Line 33, Patchset 14:openings as needed, we can handle "open track" cases separately.
Alison Maher . resolved

empty

Celeste Pan

Done

File third_party/blink/renderer/core/layout/masonry/masonry_running_positions.h
Line 211, Patchset 16: // which spans from the track's running position to infinity.
Alison Maher . resolved

If we already have track running positions, I wonder if we can just use that vector directly for this instead and assume that is from that index to infinity as additional openings.

Or maybe, IIRC track_collection_openings_ is in order, so maybe we can get rid of running_positions_ and just use track_collection_openings_ (with the assumption that the running position is always the last item in each subvector (not sure if that would be less performant in the non-dense packing case, though)

Celeste Pan

Discussed offline, I will go with this idea! A TODO was added in GetFirstEligibleLine for a possible optimization (which this idea would remove).

Line 123, Patchset 16: // case where a multi-span item is densely-packed across the "open" part of a
Alison Maher . resolved

I think using "open" here is a little confusing since there is also the concept of an opening. Maybe "empty" or something along the lines of "the part of the track after the current running position"

Celeste Pan

Responded in above comment, with a compromise, please lmk if that would make things more clear!

File third_party/blink/renderer/core/layout/masonry/masonry_running_positions.cc
Line 206, Patchset 16: // If the previous track opening has an intersecting range with where the
// current track fully "opens", add a temporary track opening that spans from
Alison Maher . resolved

"the area of the track below the current running position"

Celeste Pan

Comment removed because of structural change!

Line 207, Patchset 16: // current track fully "opens", add a temporary track opening that spans from
// the current running position of this track to infinity.
Alison Maher . resolved

Similar to a comment in the .h file, I wonder if it make sense to track running positions in this way in general, that way, we don't need to do anything special at this point

Celeste Pan

Ended up doing as suggested in the .h file!

Line 210, Patchset 14: if (running_positions_[track_to_check_for_openings] <=
previous_track_opening_end_position) {
Kurt Catti-Schmidt . resolved

Can we replace this check with the check in this section below?

`if (current_track_opening.end_position == LayoutUnit::Max()) {`

...and get rid of the temporary opening addition and removal?

Celeste Pan

It doesn't quite work to just replace the check, because that check only works inside the for-loop once we've started working with the track opening that we add in line 213.

We also would never enter the for-loop if we don't add this temporary TrackOpening; ie in the case of a completely empty track.

We could get rid of the temporary TrackOpening addition/removal, but then we'd have to have a separate outside statement, which would probably add a bit of duplicate code for calculating the overlap range, checking the number of tracks and entering the recursive method again.

Celeste Pan

Edit: comment removed as a result of a structural change.

Line 256, Patchset 16: // If we were working with the "open" ending section of a track, there
Alison Maher . resolved

Similar comment as elsewhere here

Celeste Pan

Done.

Open in Gerrit

Related details

Attention is currently required from:
  • Alison Maher
  • Ian Kilpatrick
  • Kurt Catti-Schmidt
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I961698e0e16118a2aae07ec57900b56b918332c4
Gerrit-Change-Number: 7204663
Gerrit-PatchSet: 25
Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
Gerrit-CC: Yanling Wang <yanli...@microsoft.com>
Gerrit-Attention: Alison Maher <alm...@microsoft.com>
Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Fri, 12 Dec 2025 23:18:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Celeste Pan <celes...@microsoft.com>
Comment-In-Reply-To: Alison Maher <alm...@microsoft.com>
Comment-In-Reply-To: Kurt Catti-Schmidt <ksc...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kurt Catti-Schmidt (Gerrit)

unread,
2:46 PM (9 hours ago) 2:46 PM
to Celeste Pan, Javier Fernandez, AyeAye, Ian Kilpatrick, Alison Maher, Yanling Wang, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Alison Maher, Celeste Pan and Ian Kilpatrick

Kurt Catti-Schmidt added 13 comments

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
Line 228, Patchset 26 (Latest): // If we are placing a 2-span item with a block size of 30px, then we should
Kurt Catti-Schmidt . unresolved

30px is a little confusing here, because it would fit in Track 1 without spanning. A value between 30px and 60px would be more clear.

Line 228, Patchset 26 (Latest): // If we are placing a 2-span item with a block size of 30px, then we should
Kurt Catti-Schmidt . unresolved

Inline size?

Line 141, Patchset 26 (Latest): LayoutUnit GetRunningPositionForTrack(wtf_size_t track_index) const {
Kurt Catti-Schmidt . unresolved

This could use a comment "The current running position for a given track is the start position of the final opening."

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
Line 24, Patchset 26 (Latest): // a 1D vector OR the first dimension of a 2D vector.
Kurt Catti-Schmidt . unresolved

This comment should be updated to indicate when it's 1D vs 2D.

Line 35, Patchset 26 (Latest): // Constructor for 2D vector.
Kurt Catti-Schmidt . unresolved

Like the comment above, this comment should indicate when this should be used.

Line 168, Patchset 26 (Latest): auto opening_end_index = track_collection_openings_[track_idx].size() - 1;
Kurt Catti-Schmidt . unresolved

`const auto`

Line 192, Patchset 26 (Latest): TrackOpening{new_running_position, LayoutUnit::Max()};
Kurt Catti-Schmidt . unresolved

Can this be `new_track_opening` instead of creating a new object?

Line 209, Patchset 26 (Latest): Vector<LayoutUnit> running_positions_for_span(span_size, LayoutUnit());
Kurt Catti-Schmidt . unresolved

You shouldn't use the `Vector` constructor that initializes it with values if you're going to immediately override the values afterwards. The best option here is to create an empty vector and then `ReserveInitialCapacity`.

```
Vector<LayoutUnit> running_positions_for_span;
running_positions_for_span.ReserveInitialCapacity(span_size);
```

..then in the loop, you can `emplace_back` instead of inserting at a specific position.

Line 213, Patchset 26 (Latest): GetRunningPositionForTrack(span.StartLine() + index);
Kurt Catti-Schmidt . unresolved

This can be cached in a const variable so it's not looked up each iteration

Line 240, Patchset 26 (Latest): Vector<TrackOpening>& current_track_openings =
Kurt Catti-Schmidt . unresolved

Can this `const` stay?

Line 343, Patchset 26 (Latest): // If the first track opening opening is already greater than the highest
Kurt Catti-Schmidt . unresolved

"first track opening" seems like the very first opening, is "the first opening in the current track" more accurate?

Line 346, Patchset 26 (Latest): if ((span_size > 1 && !track_collection_openings_[current_track].empty()) &&
Kurt Catti-Schmidt . unresolved

This comment should also account for span size

Line 428, Patchset 26 (Parent): if (span_size == 1) {
return running_positions_;
}
Kurt Catti-Schmidt . unresolved

Was this the optimization we lose with this approach? You should add a TODO to re-introduce it.

Open in Gerrit

Related details

Attention is currently required from:
  • Alison Maher
  • Celeste Pan
  • Ian Kilpatrick
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I961698e0e16118a2aae07ec57900b56b918332c4
    Gerrit-Change-Number: 7204663
    Gerrit-PatchSet: 26
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-CC: Yanling Wang <yanli...@microsoft.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Dec 2025 19:46:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    6:16 PM (6 hours ago) 6:16 PM
    to Celeste Pan, Javier Fernandez, AyeAye, Ian Kilpatrick, Kurt Catti-Schmidt, Yanling Wang, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan and Ian Kilpatrick

    Alison Maher added 16 comments

    Commit Message
    Line 24, Patchset 26:1b) Because of 1aa), we can remove the `running_positions_` vector and
    Alison Maher . unresolved

    nit: double "a"

    Line 28, Patchset 26:2) set `highest_eligible_track_opening` in
    Alison Maher . unresolved

    nit: Missing capitalization

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
    Line 219, Patchset 26: // This method accounts for laying multi-span items out into the open ending
    // tracks, which spans from the track's running position to infinity.
    Alison Maher . unresolved

    nit: "open ending of each track"

    Line 184, Patchset 26: track_collection_openings_[index].emplace_back(
    TrackOpening(running_positions[index], LayoutUnit::Max()));
    }
    Alison Maher . unresolved

    Should this check there isn't already an entry with a max value in each vector?

    Line 170, Patchset 26: bool IsValid() const { return !track_opening_indices.empty(); }
    Alison Maher . unresolved

    Now that every track will be represented here, will these always be valid?

    We also have a case where we set start to Max in the constructor (for collapsed tracks), so should we keep that as invalid?

    Line 141, Patchset 26: LayoutUnit GetRunningPositionForTrack(wtf_size_t track_index) const {
    return track_collection_openings_[track_index].back().start_position;
    }
    Alison Maher . unresolved

    Can this be made private?

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
    Line 23, Patchset 26: // the direction in which we iterate through the vector. This can iterate over

    // a 1D vector OR the first dimension of a 2D vector.
    Alison Maher . unresolved

    I'd remove this, and expand on the second ctr comment to note that it specifically iterates over the first dimension of track collection openings

    Line 168, Patchset 26: auto opening_end_index = track_collection_openings_[track_idx].size() - 1;
    Alison Maher . unresolved

    nit: maybe last_opening_index or running_position_idx

    Line 168, Patchset 26: auto opening_end_index = track_collection_openings_[track_idx].size() - 1;
    Alison Maher . unresolved

    This one may be useful to add a helper for. Or maybe even better, since we are only using this to get `track_collection_openings_[track_idx][opening_end_index]`, maybe a helper that gets this, and gets that idx within that helper method

    Line 177, Patchset 26: // means that a opening will be formed after placement. We should only ever
    // be accounting for track openings in the case of dense packing.
    Alison Maher . unresolved

    nit: This is no longer fully true

    Line 185, Patchset 26: track_collection_openings_[track_idx].emplace_back(new_track_opening);
    Alison Maher . unresolved

    Instead of adding a new one, can we just update the existing one's start? Could be another helper too

    Line 192, Patchset 26: TrackOpening{new_running_position, LayoutUnit::Max()};
    Alison Maher . unresolved

    Same here, can the start of this opening just be updated instead?

    Line 214, Patchset 26 (Parent): const Vector<TrackOpening>& current_track_openings =
    Alison Maher . unresolved

    Is removing this needed anymore?

    Line 211, Patchset 26: for (wtf_size_t index = 0; index < span_size; ++index) {
    running_positions_for_span[index] =
    GetRunningPositionForTrack(span.StartLine() + index);
    }

    return *(std::max_element(running_positions_for_span.begin(),
    running_positions_for_span.end()));
    Alison Maher . unresolved

    Can we calculate this max as we loop in the new for-loop instead? This would avoid double looping

    Line 306, Patchset 26: // with the existing auto-placed location of the item.
    Alison Maher . unresolved

    nit: "against"

    Line 346, Patchset 26: if ((span_size > 1 && !track_collection_openings_[current_track].empty()) &&
    Alison Maher . unresolved

    Why do we only do this if span_size is > 1? Might be worth calling out in the comment above

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Celeste Pan
    • Ian Kilpatrick
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Dec 2025 23:16:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Celeste Pan (Gerrit)

    unread,
    10:25 PM (2 hours ago) 10:25 PM
    to Javier Fernandez, AyeAye, Ian Kilpatrick, Kurt Catti-Schmidt, Alison Maher, Yanling Wang, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Alison Maher, Ian Kilpatrick and Kurt Catti-Schmidt

    Celeste Pan added 29 comments

    Commit Message
    Line 24, Patchset 26:1b) Because of 1aa), we can remove the `running_positions_` vector and
    Alison Maher . resolved

    nit: double "a"

    Celeste Pan

    Done

    Line 28, Patchset 26:2) set `highest_eligible_track_opening` in
    Alison Maher . resolved

    nit: Missing capitalization

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
    Line 228, Patchset 26: // If we are placing a 2-span item with a block size of 30px, then we should
    Kurt Catti-Schmidt . resolved

    30px is a little confusing here, because it would fit in Track 1 without spanning. A value between 30px and 60px would be more clear.

    Celeste Pan

    I can say that it has an inline size of 50px, but I think I should keep the block size of the item to demonstrate that it can be packed into the track opening!

    Line 228, Patchset 26: // If we are placing a 2-span item with a block size of 30px, then we should
    Kurt Catti-Schmidt . resolved

    Inline size?

    Celeste Pan

    It should be block size, since the item would have a height of 30px, which means it can fit into the track opening in Track 2 which has a block size/height of 30px.

    I realized that the diagram is a bit confusing, so I specified that the dotted lines represent OCCUPIED tracks.

    Line 219, Patchset 26: // This method accounts for laying multi-span items out into the open ending
    // tracks, which spans from the track's running position to infinity.
    Alison Maher . resolved

    nit: "open ending of each track"

    Celeste Pan

    Done

    Line 184, Patchset 26: track_collection_openings_[index].emplace_back(
    TrackOpening(running_positions[index], LayoutUnit::Max()));
    }
    Alison Maher . resolved

    Should this check there isn't already an entry with a max value in each vector?

    Celeste Pan

    This was fixed with the upload after responding to Kurt's comments!

    Line 170, Patchset 26: bool IsValid() const { return !track_opening_indices.empty(); }
    Alison Maher . resolved

    Now that every track will be represented here, will these always be valid?

    We also have a case where we set start to Max in the constructor (for collapsed tracks), so should we keep that as invalid?

    Celeste Pan

    When we're creating the path in `AccumulateTrackOpeningsToAccommodateItem`, we only ever start populating `track_opening_indices` once we've reached the end of what is a path that can accommodate the item, and as we go back "up" the recursive path, we add add the track opening index to the `track_opening_indices` vector. So this is still a valid indicator of whether or not we've found a series of track openings / open end of tracks to accommodate the item.

    If the start position of a track opening is set to "max", then nothing will ever be valid when we attempt to create a path across that track because the overlap range with that track will always be 0.

    Line 141, Patchset 26: LayoutUnit GetRunningPositionForTrack(wtf_size_t track_index) const {
    return track_collection_openings_[track_index].back().start_position;
    }
    Alison Maher . resolved

    Can this be made private?

    Celeste Pan

    Done

    Line 141, Patchset 26: LayoutUnit GetRunningPositionForTrack(wtf_size_t track_index) const {
    Kurt Catti-Schmidt . resolved

    This could use a comment "The current running position for a given track is the start position of the final opening."

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
    Line 24, Patchset 26: // a 1D vector OR the first dimension of a 2D vector.
    Kurt Catti-Schmidt . resolved

    This comment should be updated to indicate when it's 1D vs 2D.

    Celeste Pan

    Done

    Line 23, Patchset 26: // the direction in which we iterate through the vector. This can iterate over
    // a 1D vector OR the first dimension of a 2D vector.
    Alison Maher . resolved

    I'd remove this, and expand on the second ctr comment to note that it specifically iterates over the first dimension of track collection openings

    Celeste Pan

    This was done in response to kurt's comments in the most recent iteration.

    Line 35, Patchset 26: // Constructor for 2D vector.
    Kurt Catti-Schmidt . resolved

    Like the comment above, this comment should indicate when this should be used.

    Celeste Pan

    Done

    Line 168, Patchset 26: auto opening_end_index = track_collection_openings_[track_idx].size() - 1;
    Alison Maher . resolved

    This one may be useful to add a helper for. Or maybe even better, since we are only using this to get `track_collection_openings_[track_idx][opening_end_index]`, maybe a helper that gets this, and gets that idx within that helper method

    Celeste Pan

    I'm not entirely sure what you're looking for here, I did implement a getter for a reference to the last element though!

    Line 168, Patchset 26: auto opening_end_index = track_collection_openings_[track_idx].size() - 1;
    Alison Maher . resolved

    nit: maybe last_opening_index or running_position_idx

    Celeste Pan

    Changed to something in between, `open_ending_of_track_idx`, let me know if that works!

    Line 168, Patchset 26: auto opening_end_index = track_collection_openings_[track_idx].size() - 1;
    Kurt Catti-Schmidt . resolved

    `const auto`

    Celeste Pan

    Done

    Line 177, Patchset 26: // means that a opening will be formed after placement. We should only ever
    // be accounting for track openings in the case of dense packing.
    Alison Maher . resolved

    nit: This is no longer fully true

    Celeste Pan

    Technically we should only ever be creating new track openings in this method if dense-packing is enabled; I changed the wording so that it's more accurate to our current situation.

    Line 185, Patchset 26: track_collection_openings_[track_idx].emplace_back(new_track_opening);
    Alison Maher . resolved

    Instead of adding a new one, can we just update the existing one's start? Could be another helper too

    Celeste Pan

    Well in the previous line we're already updating the existing one's start, and then here we're adding a new track opening to account for the existing one being updated. We need to have a net addition of 1 new track opening, since we enter this conditional if a new track opening is created.

    Line 192, Patchset 26: TrackOpening{new_running_position, LayoutUnit::Max()};
    Alison Maher . resolved

    Same here, can the start of this opening just be updated instead?

    Celeste Pan

    In this case, yes we can just update it, but I do feel like it would be less lines of code and less error-prone as well. If you feel strongly that we should just update instead, please let me know!

    Line 192, Patchset 26: TrackOpening{new_running_position, LayoutUnit::Max()};
    Kurt Catti-Schmidt . resolved

    Can this be `new_track_opening` instead of creating a new object?

    Celeste Pan

    Yes!

    Line 209, Patchset 26: Vector<LayoutUnit> running_positions_for_span(span_size, LayoutUnit());
    Kurt Catti-Schmidt . resolved

    You shouldn't use the `Vector` constructor that initializes it with values if you're going to immediately override the values afterwards. The best option here is to create an empty vector and then `ReserveInitialCapacity`.

    ```
    Vector<LayoutUnit> running_positions_for_span;
    running_positions_for_span.ReserveInitialCapacity(span_size);
    ```

    ..then in the loop, you can `emplace_back` instead of inserting at a specific position.

    Celeste Pan

    Done

    Line 213, Patchset 26: GetRunningPositionForTrack(span.StartLine() + index);
    Kurt Catti-Schmidt . resolved

    This can be cached in a const variable so it's not looked up each iteration

    Celeste Pan

    Done

    Line 214, Patchset 26 (Parent): const Vector<TrackOpening>& current_track_openings =
    Alison Maher . unresolved

    Is removing this needed anymore?

    Celeste Pan

    Hm, I don't see what's being removed here. Would you mind clarifying?

    Line 211, Patchset 26: for (wtf_size_t index = 0; index < span_size; ++index) {
    running_positions_for_span[index] =
    GetRunningPositionForTrack(span.StartLine() + index);
    }

    return *(std::max_element(running_positions_for_span.begin(),
    running_positions_for_span.end()));
    Alison Maher . resolved

    Can we calculate this max as we loop in the new for-loop instead? This would avoid double looping

    Celeste Pan

    Done

    Line 240, Patchset 26: Vector<TrackOpening>& current_track_openings =
    Kurt Catti-Schmidt . resolved

    Can this `const` stay?

    Celeste Pan

    yup, thanks for the catch!

    Line 306, Patchset 26: // with the existing auto-placed location of the item.
    Alison Maher . resolved

    nit: "against"

    Celeste Pan

    Done

    Line 343, Patchset 26: // If the first track opening opening is already greater than the highest
    Kurt Catti-Schmidt . resolved

    "first track opening" seems like the very first opening, is "the first opening in the current track" more accurate?

    Celeste Pan

    yes, I'll make that more clear.

    Line 346, Patchset 26: if ((span_size > 1 && !track_collection_openings_[current_track].empty()) &&
    Alison Maher . resolved

    Why do we only do this if span_size is > 1? Might be worth calling out in the comment above

    Celeste Pan

    This was removed in response to kurt's comment!

    Line 346, Patchset 26: if ((span_size > 1 && !track_collection_openings_[current_track].empty()) &&
    Kurt Catti-Schmidt . resolved

    This comment should also account for span size

    Celeste Pan

    The span size was actually leftover code from when we were using our previous structure, so removing the span size check!

    Line 428, Patchset 26 (Parent): if (span_size == 1) {
    return running_positions_;
    }
    Kurt Catti-Schmidt . resolved

    Was this the optimization we lose with this approach? You should add a TODO to re-introduce it.

    Celeste Pan

    Yes, I added the TODO in `GetFirstEligibleLine` since that is the location where we'd re-account for the loss.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    • Ian Kilpatrick
    • Kurt Catti-Schmidt
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I961698e0e16118a2aae07ec57900b56b918332c4
    Gerrit-Change-Number: 7204663
    Gerrit-PatchSet: 29
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-CC: Yanling Wang <yanli...@microsoft.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Dec 2025 03:24:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages