Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU Aggregation (5/8): GridLayer #9096

Merged
merged 8 commits into from
Aug 22, 2024
Merged

GPU Aggregation (5/8): GridLayer #9096

merged 8 commits into from
Aug 22, 2024

Conversation

Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Aug 20, 2024

For #7457

There is a breaking change in the calculation of bins (division is moved from world space to common space)

Change List

  • Add onUpdate to AggregatorProps
  • Add customOperations to CPUAggregatorProps for legacy CPUGridLayer getColorValue, getElevationValue callbacks
  • Move GridLayer to use new AggregationLayer and aggregator classes
  • Restore unit tests
  • Restore some render tests - golden image are updated due to the breaking change above

TODO

  • The CPUGridLayer-only *ScaleType, *UpperPercentile, *LowerPercentile props are temporarily disabled. This is currently unsupported by the unified Aggregator interface. I think non-linear scales (e.g. step, sqrt, log etc.) would be a nice-to-have for both CPU and GPU aggregation. However, calculating percentiles on GPU is out of scope of v9.1.
  • 64-bit support is unavailable. Minor precision differences between CPU and GPU aggregation are expected.

This PR is already pretty big, so I'll try to bring these functionalities back in a separate PR.

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

Nice work!

@@ -13,6 +13,8 @@ export type AggregationProps = {
operations: AggregationOperation[];
/** Additional options to control bin sorting, e.g. bin size */
binOptions: Record<string, number | number[]>;
/** Callback after a channel is updated */
onUpdate?: (channel: number) => void;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Total nits: Make it more specific onUpdateChannel? Or make it extensible onUpdate(options: {channel?: number})?

getAggregatorType(): string {
const {
gpuAggregation,
// lowerPercentile,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe some TODO or explanation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See PR description

test/modules/gpu-grid-layer.spec.ts Show resolved Hide resolved
test/render/test-cases/grid-layer.js Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Aug 22, 2024

Coverage Status

coverage: 89.141% (-0.08%) from 89.221%
when pulling c9dc088 on x/aggregation-5
into bf7b002 on master.

@Pessimistress Pessimistress merged commit fdbb88a into master Aug 22, 2024
4 checks passed
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.

3 participants