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

Merge upstream #10

Merged
merged 90 commits into from
Apr 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
1e84aa5
`arrow2_convert` primitive (de)serialization benchmarks (#1742)
teh-cmc Mar 31, 2023
731d941
Fix logged obb being displayed with half of the requested size (#1749)
BenjaminDev Apr 1, 2023
ef2b5dc
benchmarks for common vector ops across `smallvec`/`tinyvec`/std (#1747)
teh-cmc Apr 1, 2023
d5b68f2
Tracked 3D cameras lead now to on-hover rays in other space views tha…
Wumpf Apr 3, 2023
2728854
Improve dealing with raw buffers for texture read/write (#1744)
Wumpf Apr 3, 2023
4439309
`arrow2` erased refcounted clones benchmarks (#1745)
teh-cmc Apr 3, 2023
29a13ea
`arrow2` estimated_bytes_size benchmarks (#1743)
teh-cmc Apr 3, 2023
d94ca3d
Fix crash when trying to do picking on depth clouds
emilk Apr 4, 2023
bf27c8e
Readback depth from GPU picking (#1752)
Wumpf Apr 4, 2023
a479c0c
Add new ARKitScenes example (#1538)
pablovela5620 Apr 4, 2023
1946683
Fix log_obb usage (#1761)
emilk Apr 4, 2023
9c1babe
Python SDK: document that we also accept colors in 0-1 floats (#1740)
emilk Apr 4, 2023
7892098
Collapse space-view by default if there is only one child (#1762)
emilk Apr 4, 2023
1713e60
Always create the log_time timeline (#1763)
jleibs Apr 4, 2023
9310bd7
Columnar timepoints in data tables and during transport (#1767)
teh-cmc Apr 4, 2023
6c383c3
Fix undo/redo selection shortcut/action changing selection history wi…
Wumpf Apr 4, 2023
b9f1380
Don't initialize an SDK session if we are only going to be launching …
jleibs Apr 4, 2023
679e245
Allow torch tensors for log_rigid3 (#1769)
jleibs Apr 4, 2023
409dcd8
Option to show scene bounding box (#1770)
emilk Apr 4, 2023
5b590bb
Fix a whole lot of crashes, all at once (#1780)
emilk Apr 5, 2023
260c532
Add typing_extensions to requirements-doc.txt (#1786)
jleibs Apr 5, 2023
83cd229
auto_color class-ids if they are present (#1783)
jleibs Apr 5, 2023
a4f59b2
Don't run 3rd party bench suites on CI (#1787)
teh-cmc Apr 6, 2023
d6cce1c
Use copilot markers in PR template (#1784)
emilk Apr 6, 2023
3be747c
re_format: barebone support for custom formatting (#1776)
teh-cmc Apr 6, 2023
aedf1c0
Always send recording_id as part of LogMsg (#1778)
jleibs Apr 6, 2023
ab26a73
Refactor: Add new helper crate `re_log_encoding` (#1772)
emilk Apr 6, 2023
8ab1155
New example code for facebook research segment anything (#1788)
jleibs Apr 6, 2023
880cf8e
Implement `re_tuid::Tuid::random()` on web (#1796)
emilk Apr 8, 2023
e3f572f
ci: fix benchmarks (#1799)
teh-cmc Apr 8, 2023
49e260a
Add `minimal_options` example (`RerunArgs`) (#1773)
h3mosphere Apr 10, 2023
5c7f527
Add `pacman` support to `setup_web.sh` (#1797)
urholaukkarinen Apr 10, 2023
49d5de8
fix ci (cargo-deny): cargo update -p crossbeam-channel (#1806)
teh-cmc Apr 10, 2023
d852534
Compile with `panic = "abort"` (#1813)
emilk Apr 11, 2023
7d4514e
Add `rerun --strict`: crash if any warning or error is logged (#1812)
emilk Apr 11, 2023
c254e2f
Refactor: Remove `TensorTrait` (#1819)
emilk Apr 11, 2023
5da248d
End-to-end testing of python logging -> store ingestion (#1817)
emilk Apr 12, 2023
c472b07
Fix e2e test on CI: Don't try to re-build rerun-sdk (#1821)
emilk Apr 12, 2023
f7cdc66
Use gpu picking for points, streamline/share picking code some more (…
Wumpf Apr 12, 2023
fef1eda
CI: install pip requirements for Python e2e test
emilk Apr 12, 2023
43befc2
Process 2d points always in batches (#1820)
Wumpf Apr 12, 2023
48fda31
Fix CI syntax error
emilk Apr 12, 2023
668e56d
New option to disable persistent storage (#1825)
jleibs Apr 12, 2023
dd6f03e
New API to reset_time (#1826)
jleibs Apr 12, 2023
8b0aa2e
Datastore revamp 1: new indexing model & core datastructures (#1727)
teh-cmc Apr 12, 2023
893138b
Datastore revamp 2: serialization & formatting (#1735)
teh-cmc Apr 12, 2023
698e51b
Datastore revamp 3: efficient incremental stats (#1739)
teh-cmc Apr 12, 2023
6bd5323
Datastore revamp 4: sunset `MsgId` (#1785)
teh-cmc Apr 12, 2023
72de79e
Datastore revamp 5: (#1791)
teh-cmc Apr 12, 2023
b7bbe10
Datastore revamp 6: sunset `LogMsg` storage + save store to disk (#1795)
teh-cmc Apr 12, 2023
d2d83d7
Datastore revamp 7: garbage collection (#1801)
teh-cmc Apr 12, 2023
c181adf
Don't assert if inserting a rowid with a matching timepoint does not …
jleibs Apr 12, 2023
0f6e268
CI: Try installing the correct wheel on CI
emilk Apr 12, 2023
6bec48e
CI: try again with the CI
emilk Apr 12, 2023
1e2515c
re_query: up to date with latest data types and structures (#1828)
teh-cmc Apr 12, 2023
925f531
datastore: incremental metadata registry stats (#1833)
teh-cmc Apr 13, 2023
cb95f5e
RFC: datastore state of the union & end-to-end batching (#1610)
teh-cmc Apr 13, 2023
fd870f0
Python CI: use bash as shell
emilk Apr 13, 2023
9716235
Fix too many points crash (#1822)
Wumpf Apr 13, 2023
780fe1c
Use GPU picking for line(like) primitives, fix `interactive` flags (#…
Wumpf Apr 13, 2023
8ce2c89
CI: try to fix mac wheel build
emilk Apr 13, 2023
4ef2c07
Reduce memory used by staging belts on Web (#1836)
Wumpf Apr 13, 2023
24f22dc
CI: only test the x86_64 wheel on macos
emilk Apr 13, 2023
48d4f28
Always flush when we remove a sink (#1830)
jleibs Apr 13, 2023
437fe2b
GPU colormapping, first step (#1835)
emilk Apr 13, 2023
1211ef4
Test and handle all tensor dtypes as images (#1840)
emilk Apr 13, 2023
e8e2d9b
Install the rerun-sdk in CI using --no-index and split out linux whee…
jleibs Apr 14, 2023
fe7ac0e
GPU tensor colormapping (#1841)
emilk Apr 14, 2023
beffbc3
Show previews of colormaps when selecting them (#1846)
emilk Apr 14, 2023
d33dab6
Implement billinear filtering of textures (#1850)
emilk Apr 14, 2023
3cd534f
MVP Support for inline-rendering of Rerun within jupyter notebooks (#…
jleibs Apr 14, 2023
5dc9b61
Disable wheel tests for x86_64-apple-darwin (#1853)
jleibs Apr 14, 2023
13c96bb
Fix typos in notebook readme (#1852)
jleibs Apr 14, 2023
b4190d8
Fix the python build when running without web_viewer enabled (#1856)
jleibs Apr 14, 2023
666c0c6
Error instead of expect inside msg_encode. (#1857)
jleibs Apr 14, 2023
8d25b9e
Restore: New API to reset_time (#1826) (#1854)
jleibs Apr 14, 2023
625d2bd
Revert "Implement billinear filtering of textures (#1850)" (#1859)
jleibs Apr 14, 2023
c3a13db
Add Restart command and keyboard shortcut for moving time to start of…
h3mosphere Apr 15, 2023
69bf801
Fix shutdown race condition in `re_sdk_comms` client (#1861)
emilk Apr 15, 2023
7533ed2
Remove unused dependencies (#1863)
emilk Apr 15, 2023
43aa22c
Gpu picking for depth clouds (#1849)
Wumpf Apr 16, 2023
63f19e7
Remove manual depth projection from car and nyud examples (#1869)
emilk Apr 17, 2023
87906dc
Improve end-to-end testing slightly (#1862)
emilk Apr 17, 2023
adf9856
Re-enable bilinear interpolation again (#1860)
emilk Apr 17, 2023
c7f5cb6
Use GPU colormapping when showing images in the GUI (#1865)
emilk Apr 17, 2023
f35efec
Turn off benchmakrs comment on each PR (#1872)
emilk Apr 17, 2023
ccc20c2
Refactor: remove `GpuTexture2DHandle::invalid` (#1866)
emilk Apr 17, 2023
138165a
Update enumflags2 to non-yanked version (#1874)
emilk Apr 17, 2023
88c9748
Merge branch 'main' of github.com:rerun-io/rerun into merge-upstream
zrezke Apr 17, 2023
a32e773
fix stuff broken from merging upstream
zrezke Apr 17, 2023
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
Prev Previous commit
Next Next commit
Datastore revamp 6: sunset LogMsg storage + save store to disk (rer…
teh-cmc authored Apr 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b7bbe103eb631ba188daf2527d605174ea7c73c1
77 changes: 30 additions & 47 deletions crates/re_data_store/src/log_db.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::collections::BTreeMap;

use nohash_hasher::IntMap;

use re_arrow_store::{DataStoreConfig, TimeInt};
@@ -159,33 +161,31 @@ impl EntityDb {
/// A in-memory database built from a stream of [`LogMsg`]es.
#[derive(Default)]
pub struct LogDb {
/// Messages in the order they arrived
chronological_row_ids: Vec<RowId>,
log_messages: ahash::HashMap<RowId, LogMsg>,

/// Data that was logged with [`TimePoint::timeless`].
/// We need to re-insert those in any new timelines
/// that are created after they were logged.
timeless_row_ids: Vec<RowId>,
/// All [`EntityPathOpMsg`]s ever received.
entity_op_msgs: BTreeMap<RowId, EntityPathOpMsg>,

/// Set by whomever created this [`LogDb`].
pub data_source: Option<re_smart_channel::Source>,

/// Comes in a special message, [`LogMsg::BeginRecordingMsg`].
recording_info: Option<RecordingInfo>,
recording_msg: Option<BeginRecordingMsg>,

/// Where we store the entities.
pub entity_db: EntityDb,
}

impl LogDb {
pub fn recording_msg(&self) -> Option<&BeginRecordingMsg> {
self.recording_msg.as_ref()
}

pub fn recording_info(&self) -> Option<&RecordingInfo> {
self.recording_info.as_ref()
self.recording_msg().map(|msg| &msg.info)
}

pub fn recording_id(&self) -> RecordingId {
if let Some(info) = &self.recording_info {
info.recording_id
if let Some(msg) = &self.recording_msg {
msg.info.recording_id
} else {
RecordingId::ZERO
}
@@ -203,11 +203,16 @@ impl LogDb {
self.entity_db.tree.num_timeless_messages()
}

pub fn num_rows(&self) -> usize {
self.entity_db.data_store.total_timeless_rows() as usize
+ self.entity_db.data_store.total_temporal_rows() as usize
}

pub fn is_empty(&self) -> bool {
self.log_messages.is_empty()
self.num_rows() == 0
}

pub fn add(&mut self, msg: LogMsg) -> Result<(), Error> {
pub fn add(&mut self, msg: &LogMsg) -> Result<(), Error> {
crate::profile_function!();

match &msg {
@@ -218,38 +223,27 @@ impl LogDb {
time_point,
path_op,
} = msg;
self.entity_op_msgs.insert(*row_id, msg.clone());
self.entity_db.add_path_op(*row_id, time_point, path_op);
}
LogMsg::ArrowMsg(_, inner) => self.entity_db.try_add_arrow_msg(inner)?,
LogMsg::Goodbye(_) => {}
}

// TODO(#1619): the following only makes sense because, while we support sending and
// receiving batches, we don't actually do so yet.
// We need to stop storing raw `LogMsg`s before we can benefit from our batching.
self.chronological_row_ids.push(msg.id());
self.log_messages.insert(msg.id(), msg);

Ok(())
}

fn add_begin_recording_msg(&mut self, msg: &BeginRecordingMsg) {
self.recording_info = Some(msg.info.clone());
self.recording_msg = Some(msg.clone());
}

pub fn len(&self) -> usize {
self.log_messages.len()
/// Returns an iterator over all [`EntityPathOpMsg`]s that have been written to this `LogDb`.
pub fn iter_entity_op_msgs(&self) -> impl Iterator<Item = &EntityPathOpMsg> {
self.entity_op_msgs.values()
}

/// In the order they arrived
pub fn chronological_log_messages(&self) -> impl Iterator<Item = &LogMsg> {
self.chronological_row_ids
.iter()
.filter_map(|id| self.get_log_msg(id))
}

pub fn get_log_msg(&self, row_id: &RowId) -> Option<&LogMsg> {
self.log_messages.get(row_id)
pub fn get_entity_op_msg(&self, row_id: &RowId) -> Option<&EntityPathOpMsg> {
self.entity_op_msgs.get(row_id)
}

/// Free up some RAM by forgetting the older parts of all timelines.
@@ -263,26 +257,15 @@ impl LogDb {
let cutoff_times = self.entity_db.data_store.oldest_time_per_timeline();

let Self {
chronological_row_ids,
log_messages,
timeless_row_ids,
entity_op_msgs,
data_source: _,
recording_info: _,
recording_msg: _,
entity_db,
} = self;

{
crate::profile_scope!("chronological_row_ids");
chronological_row_ids.retain(|row_id| !drop_row_ids.contains(row_id));
}

{
crate::profile_scope!("log_messages");
log_messages.retain(|row_id, _| !drop_row_ids.contains(row_id));
}
{
crate::profile_scope!("timeless_row_ids");
timeless_row_ids.retain(|row_id| !drop_row_ids.contains(row_id));
crate::profile_scope!("entity_op_msgs");
entity_op_msgs.retain(|row_id, _| !drop_row_ids.contains(row_id));
}

entity_db.purge(&cutoff_times, &drop_row_ids);
11 changes: 11 additions & 0 deletions crates/re_log_encoding/src/encoder.rs
Original file line number Diff line number Diff line change
@@ -98,3 +98,14 @@ pub fn encode<'a>(
}
encoder.finish()
}

pub fn encode_owned(
messages: impl Iterator<Item = LogMsg>,
write: impl std::io::Write,
) -> Result<(), EncodeError> {
let mut encoder = Encoder::new(write)?;
for message in messages {
encoder.append(&message)?;
}
encoder.finish()
}
2 changes: 1 addition & 1 deletion crates/re_log_types/src/data_table.rs
Original file line number Diff line number Diff line change
@@ -555,7 +555,7 @@ impl DataTable {
/// Internally, time columns are (de)serialized separately from the rest of the control
/// columns for efficiency/QOL concerns: that doesn't change the fact that they are control
/// columns all the same!
/// * Data columns are the one that hold component data.
/// * Data columns are the ones that hold component data.
/// They are optional, potentially sparse, and never deserialized on the server-side (not by
/// the storage systems, at least).
pub fn serialize(&self) -> DataTableResult<(Schema, Chunk<Box<dyn Array>>)> {
113 changes: 51 additions & 62 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
@@ -527,7 +527,7 @@ impl eframe::App for App {
log_db,
)
.selection_state
.on_frame_start(log_db, blueprint);
.on_frame_start(blueprint);

{
// TODO(andreas): store the re_renderer somewhere else.
@@ -704,7 +704,7 @@ impl App {
log_db.data_source = Some(self.rx.source().clone());
}

if let Err(err) = log_db.add(msg) {
if let Err(err) = log_db.add(&msg) {
re_log::error!("Failed to add incoming msg: {err}");
};

@@ -916,8 +916,6 @@ fn preview_files_being_dropped(egui_ctx: &egui::Context) {
enum PanelSelection {
#[default]
Viewport,

EventLog,
}

#[derive(Default, serde::Deserialize, serde::Serialize)]
@@ -940,8 +938,6 @@ struct AppState {
/// Which view panel is currently being shown
panel_selection: PanelSelection,

event_log_view: crate::event_log_view::EventLogView,

selection_panel: crate::selection_panel::SelectionPanel,
time_panel: crate::time_panel::TimePanel,

@@ -969,7 +965,6 @@ impl AppState {
selected_rec_id,
recording_configs,
panel_selection,
event_log_view,
blueprints,
selection_panel,
time_panel,
@@ -1014,7 +1009,6 @@ impl AppState {
.entry(selected_app_id)
.or_insert_with(|| Blueprint::new(ui.ctx()))
.blueprint_panel_and_viewport(&mut ctx, ui),
PanelSelection::EventLog => event_log_view.ui(&mut ctx, ui),
});

// move time last, so we get to see the first data first!
@@ -1523,7 +1517,13 @@ fn save(app: &mut App, loop_selection: Option<(re_data_store::Timeline, TimeRang
.set_title(title)
.save_file()
{
let f = save_database_to_file(app.log_db(), path, loop_selection);
let f = match save_database_to_file(app.log_db(), path, loop_selection) {
Ok(f) => f,
Err(err) => {
re_log::error!("File saving failed: {err}");
return;
}
};
if let Err(err) = app.spawn_threaded_promise(FILE_SAVER_PROMISE, f) {
// NOTE: Shouldn't even be possible as the "Save" button is already
// grayed out at this point... better safe than sorry though.
@@ -1546,16 +1546,6 @@ fn main_view_selector_ui(ui: &mut egui::Ui, app: &mut App) {
{
ui.close_menu();
}
if ui
.selectable_value(
&mut app.state.panel_selection,
PanelSelection::EventLog,
"Event Log",
)
.clicked()
{
ui.close_menu();
}
});
}
}
@@ -1760,57 +1750,56 @@ fn save_database_to_file(
log_db: &LogDb,
path: std::path::PathBuf,
time_selection: Option<(re_data_store::Timeline, TimeRangeF)>,
) -> impl FnOnce() -> anyhow::Result<std::path::PathBuf> {
use re_log_types::{EntityPathOpMsg, TimeInt};

let msgs = match time_selection {
// Fast path: no query, just dump everything.
None => log_db
.chronological_log_messages()
.cloned()
.collect::<Vec<_>>(),

// Query path: time to filter!
Some((timeline, range)) => {
use std::ops::RangeInclusive;
let range: RangeInclusive<TimeInt> = range.min.floor()..=range.max.ceil();
log_db
.chronological_log_messages()
.filter(|msg| {
match msg {
LogMsg::BeginRecordingMsg(_) | LogMsg::Goodbye(_) => {
true // timeless
}
LogMsg::EntityPathOpMsg(_, EntityPathOpMsg { time_point, .. }) => {
time_point.is_timeless() || {
let is_within_range = time_point
.get(&timeline)
.map_or(false, |t| range.contains(t));
is_within_range
}
}
LogMsg::ArrowMsg(_, _) => {
// TODO(john)
false
}
}
})
.cloned()
.collect::<Vec<_>>()
}
};
) -> anyhow::Result<impl FnOnce() -> anyhow::Result<std::path::PathBuf>> {
use re_arrow_store::TimeRange;

crate::profile_scope!("dump_messages");

move || {
let begin_rec_msg = log_db
.recording_msg()
.map(|msg| LogMsg::BeginRecordingMsg(msg.clone()));

let ent_op_msgs = log_db
.iter_entity_op_msgs()
.map(|msg| LogMsg::EntityPathOpMsg(log_db.recording_id(), msg.clone()))
.collect_vec();

let time_filter = time_selection.map(|(timeline, range)| {
(
timeline,
TimeRange::new(range.min.floor(), range.max.ceil()),
)
});
let data_msgs: Result<Vec<_>, _> = log_db
.entity_db
.data_store
.to_data_tables(time_filter)
.map(|table| {
table
.to_arrow_msg()
.map(|msg| LogMsg::ArrowMsg(log_db.recording_id(), msg))
})
.collect();

use anyhow::Context as _;
let data_msgs = data_msgs.with_context(|| "Failed to export to data tables")?;

let msgs = std::iter::once(begin_rec_msg)
.flatten() // option
.chain(ent_op_msgs)
.chain(data_msgs);

Ok(move || {
crate::profile_scope!("save_to_file");

use anyhow::Context as _;
let file = std::fs::File::create(path.as_path())
.with_context(|| format!("Failed to create file at {path:?}"))?;

re_log_encoding::encoder::encode(msgs.iter(), file)
re_log_encoding::encoder::encode_owned(msgs, file)
.map(|_| path)
.context("Message encode")
}
})
}

#[allow(unused_mut)]
@@ -1821,7 +1810,7 @@ fn load_rrd_to_log_db(mut read: impl std::io::Read) -> anyhow::Result<LogDb> {

let mut log_db = LogDb::default();
for msg in decoder {
log_db.add(msg?)?;
log_db.add(&msg?)?;
}
Ok(log_db)
}
2 changes: 1 addition & 1 deletion crates/re_viewer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ mod viewer_analytics;

pub(crate) use misc::{mesh_loader, Item, TimeControl, TimeView, ViewerContext};
use re_log_types::PythonVersion;
pub(crate) use ui::{event_log_view, memory_panel, selection_panel, time_panel, UiVerbosity};
pub(crate) use ui::{memory_panel, selection_panel, time_panel, UiVerbosity};

pub use app::{App, StartupOptions};
pub use remote_viewer_app::RemoteViewerApp;
Loading