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

Enforce the rule: heuristics should never add a new view that would be completely covered by an existing view #5164

Merged
merged 8 commits into from Feb 12, 2024

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Feb 9, 2024

What

This evaluates the queries of newly added space-views and doesn't add them if there already exists a space-view that would contain the same contents. This eliminates most of the worst offenders of unneeded-space-view creation, though re-loading recordings can still cause spurious root-space-views since those wouldn't technically be redundant.

Because this check operates on the query expressions it's independent of the actual state of the entity-tree.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

@jleibs jleibs added heuristics Space-view heuristics etc 🦟 regression A thing that used to work in an earlier release labels Feb 9, 2024
@jleibs jleibs added this to the 0.13 milestone Feb 9, 2024
@jleibs jleibs marked this pull request as ready for review February 9, 2024 18:22
crates/re_log_types/src/path/entity_path_filter.rs Outdated Show resolved Hide resolved
Comment on lines 520 to 533
// TODO(jleibs): Handle multi-query-aggregation

// If other has no query, by definition we contain all entities from it.
let Some(q_other) = other.queries.first() else {
return true;
};

// If other has any query, but self has no query, we clearly can't contain it
let Some(q_self) = self.queries.first() else {
return false;
};

// If this query fully contains the other, then we have all its entities
q_self.fully_contains(q_other)
Copy link
Member

@emilk emilk Feb 12, 2024

Choose a reason for hiding this comment

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

This seems like a big shortcoming that this only handles queries.len() == 1 on both sides, and not even returning a conservative estimate in the other cases

crates/re_viewport/src/viewport.rs Outdated Show resolved Hide resolved
@emilk emilk requested a review from Wumpf February 12, 2024 08:38
@emilk
Copy link
Member

emilk commented Feb 12, 2024

I don't understand the nuances of the heuristics enough to feel confident merging this without @Wumpf taking a look first

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

commentary only so far - looks almost good, but I need to test now the issue in should_auto_add_space_view

crates/re_viewport/src/viewport.rs Show resolved Hide resolved
crates/re_space_view/src/space_view.rs Outdated Show resolved Hide resolved
crates/re_space_view/src/data_query_blueprint.rs Outdated Show resolved Hide resolved
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

it's a clear improvement. I'll fix up comments & naming and merge

worth noting that naturally, at this point we still have the problem of the / space view being created prematurely and then not removed as images come in
image

@Wumpf
Copy link
Member

Wumpf commented Feb 12, 2024

actually something weird here: Why is the root view added, that shouldn't have happend.
So on initial run I get the root and only the root
image

but then reset. Close. open again. I get the root again as in my screenshot from the previous comment:
image

@Wumpf
Copy link
Member

Wumpf commented Feb 12, 2024

I believe the problem is that the heuristic still proposes / after it already has the other two space views which were loaded on startup. / is clearly not a superset of the other two so it's added.

@Wumpf
Copy link
Member

Wumpf commented Feb 12, 2024

Seems to be all addressed in the follow-up PR :) (started testing it without reading yet)

@Wumpf Wumpf added the 📺 re_viewer affects re_viewer itself label Feb 12, 2024
@Wumpf Wumpf merged commit 2ebc621 into main Feb 12, 2024
40 of 41 checks passed
@Wumpf Wumpf deleted the jleibs/no_redundant_space_view branch February 12, 2024 10:13
@Wumpf Wumpf mentioned this pull request Feb 12, 2024
Wumpf added a commit that referenced this pull request Feb 12, 2024
### What
 - Builds on top of #5164

Adds a store subscriber for tracking the dimensions of image entities.

Gets rid of the previous bucketing logic and replaces it with a new
implementation that starts at the top of the subspace and incrementally
splits when it finds conflicting image entities within the space.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5166/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5166/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5166/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5166)
- [Docs
preview](https://rerun.io/preview/da9a0d206235016d14d9826e8c42ed8481d29643/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/da9a0d206235016d14d9826e8c42ed8481d29643/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
Wumpf added a commit that referenced this pull request Feb 12, 2024
…e completely covered by an existing view (#5164)

### What
- Resolves: #5152

This evaluates the queries of newly added space-views and doesn't add
them if there already exists a space-view that would contain the same
contents. This eliminates most of the worst offenders of
unneeded-space-view creation, though re-loading recordings can still
cause spurious root-space-views since those wouldn't technically be
redundant.

Because this check operates on the query expressions it's independent of
the actual state of the entity-tree.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5164/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5164/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5164/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5164)
- [Docs
preview](https://rerun.io/preview/e35bd2e974540f0b3b2b9c2759f64dbfa635d515/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/e35bd2e974540f0b3b2b9c2759f64dbfa635d515/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Wumpf added a commit that referenced this pull request Feb 12, 2024
### What
 - Builds on top of #5164

Adds a store subscriber for tracking the dimensions of image entities.

Gets rid of the previous bucketing logic and replaces it with a new
implementation that starts at the top of the subspace and incrementally
splits when it finds conflicting image entities within the space.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5166/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5166/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5166/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5166)
- [Docs
preview](https://rerun.io/preview/da9a0d206235016d14d9826e8c42ed8481d29643/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/da9a0d206235016d14d9826e8c42ed8481d29643/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
heuristics Space-view heuristics etc include in changelog 📺 re_viewer affects re_viewer itself 🦟 regression A thing that used to work in an earlier release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad incremental heuristics for Detect and Track Objects
3 participants