Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 9 additions & 22 deletions docs/filtersets.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
THE FILTERSET CALCULUS
THE FILTERSET CALCULUS (v2)
---

### TYPES

```rust
type FiltersetId = usize;
type PreidcateId = usize;
struct Predicate {
attr: String,
rel: Ordering,
Expand All @@ -14,9 +15,8 @@ struct Predicate {
enum Filterset {
Dead,
Primitive(Roaring),
Rel(Predicate, FiltersetId),
RelIntersect(Vec<Predicate>, FiltersetId),
RelUnion(Vec<Predicate>, FiltersetId),
BlackBox(FiltersetId),
RelDnf(Vec<Vec<PredicateId>>, FiltersetId),
And(Vec<FiltersetId>),
Or(Vec<FiltersetId>),
Not(FiltersetId),
Expand All @@ -30,25 +30,12 @@ enum Filterset {
And([... And(children) ...]) -> And(flattened)
Or([... Or(children) ...]) -> Or(flattened)
Not(Not(X)) -> X

**Eliminating trivial ops (unimplemeneted)**
And([A]) -> A
Or([A]) -> A

**REL composition**

I. Rel(p1, Rel(p2, A)) -> RelIntersect([p1, p2], A)
II. Rel(p, RelIntersect(ps, A)) -> RelIntersect([p] + ps, A)
III. RelIntersect(ps1, RelIntersect(ps2, A)) -> RelIntersect(ps1 + ps2, A)
IV. RelIntersect(ps, Rel(p, A)) -> RelIntersect(ps + [p], A)
V. RelUnion(ps1, RelUnion(ps2, A)) -> RelUnion(ps1 + ps2, A)

**One Rule To Rule Them All**
1. RelDnf(clauses, RelDnf(clauses2, A)) -> new clauses: c_1 \times c_2 (if the result won't be too big)

**Flattening on the same level (unimplemeneted)**
And([RelIntersect(ps, A), RelIntersect(ps2, A), RelIntersect(_, B) ...])
-> And([RelIntersect(ps1+ps2, A), RelIntersect(_, B)])
- This could be hard to detect, instead there could be just:
And([RelIntersect(ps_1, A), .. RelIntersect(ps_n, A)]) -> RelIntersect(ps_1+..+ps_n, A)
Or([RelUnion(ps, A), RelUnion(ps2, A), RelUnion(_, B) ...])
-> Or([RelUnion(ps1+ps2, A), RelIntersect(_, B)])
- same applies here.
**RelDnf in Or/And**
1. Or([RelDnf(c, A), RelDnf(c2, A), RelDnf(c3, B), RelDnf(c4, B)]) -> Or([RelDnf(c+c2, A), RelDnf(c3+c4, B)])
2. And([RelDnf(c, A), RelDnf(c2, A), RelDnf(c3, B), RelDnf(c4, B)]) -> And([RelDnf(c x c2, A), RelDnf(c3 x c4, B)]) (if not too big)
3 changes: 2 additions & 1 deletion entrace_core/src/log_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ pub trait LogProvider {
/// This MUST be cheap as the frontend might call this every frame.
fn len(&self) -> usize;

/// The frontent SHOULD call this at the beginning of each painted frame.
/// The frontent SHOULD call this at the beginning of each painted frame,
/// but there is no guarantee to whether or when it will.
/// This runs on the main thread.
/// The [LogProvider] implementation MUST ensure that this terminates quickly,
/// as it directly affects FPS.
Expand Down
1 change: 1 addition & 0 deletions entrace_query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ anyhow = "1.0.100"
memchr = "2.7.6"
thiserror = "2.0.17"
roaring = "0.11.2"
itertools = "0.14.0"

[[bin]]
name="entrace-query-test"
Expand Down
Loading
Loading