Skip to content

[scd] Make repo search/notify methods cells-native - #1711

Merged
mickmis merged 1 commit into
interuss:masterfrom
Orbitalize:scd_search_repos_cells_filter
Sep 23, 2026
Merged

mickmis merged 1 commit into
interuss:masterfrom
Orbitalize:scd_search_repos_cells_filter

Conversation

@MariemBaccari

@MariemBaccari MariemBaccari commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Following this discussion under #1670, this PR makes the SCD search and increment repo methods take a cells based volume instead of the current *dssmodels.Volume4D. This way, the backends no longer recompute the S2 covering themselves and this is done at the http handler level. Eventually, this will allow us to pre-compute the S2 cells covering before proposing to Raft to avoid floating point arithmetics related to geometry on the apply path.
The PR also adds a missing sort in precomputedCellGeometry.CalculateCovering().

Implements #1701

@MariemBaccari
MariemBaccari force-pushed the scd_search_repos_cells_filter branch 6 times, most recently from 9a65891 to 146fb77 Compare September 21, 2026 19:58
@MariemBaccari
MariemBaccari marked this pull request as ready for review September 21, 2026 22:11

@mickmis mickmis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a great simplification, that can actually be taken a step further, see my comments. At the end of the day I don't think the DSS ever has to process the geometries of the Volume4D directly?
So LGTM modulo comments.

Comment thread pkg/models/geo.go Outdated
}

// Map iteration order is random and some CellUnion methods like Contains require a sorted union.
sort.Slice(result, func(i, j int) bool { return result[i] < result[j] })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like this should be a guarantee of CalculateCovering. If you agree can you split that up in a separate PR, implement it in other implementations, and add this to the interface doc?
In addition, this should be covered by unit tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, opened #1722 to address this :)

Comment thread pkg/scd/operations/constraint.go
Comment thread pkg/scd/operations/constraint.go
Comment thread pkg/scd/operations/operational_intents.go Outdated
Comment thread pkg/scd/operations/operational_intents.go
Comment thread pkg/scd/operations/subscription.go Outdated
Comment thread pkg/scd/store/memstore/subscriptions.go Outdated
@MariemBaccari
MariemBaccari force-pushed the scd_search_repos_cells_filter branch 4 times, most recently from 5370c95 to 640eb15 Compare September 22, 2026 16:14
@MariemBaccari
MariemBaccari force-pushed the scd_search_repos_cells_filter branch 2 times, most recently from 34f6bfc to 8a59499 Compare September 22, 2026 21:19

@mickmis mickmis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few minor comments. This is a nice improvement!

Comment thread pkg/scd/models/operational_intents.go Outdated
result.TimeStart = restapi.Time{
Value: o.StartTime.Format(time.RFC3339Nano),
Format: TimeFormatRFC3339,
if o.CellsVolume4D != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since CellsVolume4D is embedded, you don't actually need to check for it being nil when accessing its fields. Demo: https://go.dev/play/p/0g1bLtymQNw
Applies to all others too

@MariemBaccari MariemBaccari Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome ! I didn't know about this :)

return nil, stacktrace.Propagate(err, "Error constructing 4D volumes union")
}
// Compute total affected cellsVolume for notification purposes
notifyCellsVol4D := validParams.volume

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment thread pkg/scd/operations/operational_intents.go Outdated
Comment thread pkg/scd/operations/operational_intents.go
Comment thread pkg/models/geo.go
@MariemBaccari
MariemBaccari force-pushed the scd_search_repos_cells_filter branch from 8a59499 to 5724180 Compare September 23, 2026 12:48
@MariemBaccari
MariemBaccari force-pushed the scd_search_repos_cells_filter branch from 5724180 to d268550 Compare September 23, 2026 12:50
@mickmis
mickmis merged commit a49a284 into interuss:master Sep 23, 2026
18 checks passed
@mickmis
mickmis deleted the scd_search_repos_cells_filter branch September 23, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants