Skip to content

Commit 4ad2d1a

Browse files
committed
CI metadata fixes
1 parent 285cbc9 commit 4ad2d1a

8 files changed

Lines changed: 56 additions & 50 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- name: Checkout source
2828
uses: actions/checkout@v4
2929
with:
30+
fetch-depth: 0
3031
submodules: recursive
3132

3233
- name: Install CUDA 12.8

.github/workflows/ubuntu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- name: Checkout source
4141
uses: actions/checkout@v4
4242
with:
43+
fetch-depth: 0
4344
submodules: recursive
4445

4546
- name: Free disk space

.github/workflows/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
- name: Checkout source
100100
uses: actions/checkout@v4
101101
with:
102+
fetch-depth: 0
102103
submodules: recursive
103104

104105
- name: Install CUDA 12.8

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,23 @@ execute_process(
3939
ERROR_QUIET
4040
)
4141
execute_process(
42-
COMMAND git describe --dirty
42+
COMMAND git describe --tags --dirty --always --match "v*"
4343
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
4444
OUTPUT_VARIABLE GIT_TAGGED_VERSION
4545
OUTPUT_STRIP_TRAILING_WHITESPACE
4646
ERROR_QUIET
4747
)
48+
if(NOT GIT_COMMIT_HASH_SHORT AND DEFINED ENV{GITHUB_SHA} AND NOT "$ENV{GITHUB_SHA}" STREQUAL "")
49+
string(SUBSTRING "$ENV{GITHUB_SHA}" 0 7 GIT_COMMIT_HASH_SHORT)
50+
endif()
51+
if(NOT GIT_TAGGED_VERSION)
52+
if(DEFINED ENV{GITHUB_REF_TYPE} AND "$ENV{GITHUB_REF_TYPE}" STREQUAL "tag" AND
53+
DEFINED ENV{GITHUB_REF_NAME} AND NOT "$ENV{GITHUB_REF_NAME}" STREQUAL "")
54+
set(GIT_TAGGED_VERSION "$ENV{GITHUB_REF_NAME}")
55+
elseif(GIT_COMMIT_HASH_SHORT)
56+
set(GIT_TAGGED_VERSION "${GIT_COMMIT_HASH_SHORT}")
57+
endif()
58+
endif()
4859
if(NOT GIT_COMMIT_HASH_SHORT)
4960
set(GIT_COMMIT_HASH_SHORT "unknown")
5061
endif()

src/python/lfs/module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ Camera Control:
17411741
});
17421742

17431743
// Module metadata
1744-
m.attr("__version__") = "0.1.0";
1744+
m.attr("__version__") = GIT_TAGGED_VERSION;
17451745
m.attr("__all__") = nb::make_tuple(
17461746
// Core access
17471747
"context", "gaussians", "session", "get_scene",

src/python/lfs_plugins/compat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
SpecifierSet = Version = None
1515

1616

17-
LICHTFELD_VERSION = "0.5.0"
17+
# Keep this aligned with the latest released LichtFeld host version used for
18+
# plugin compatibility resolution in source-only Python contexts.
19+
LICHTFELD_VERSION = "0.5.1"
1820
PLUGIN_API_VERSION = "1.0"
1921
SUPPORTED_PLUGIN_FEATURES = (
2022
"capabilities.v1",

src/visualizer/scene/scene_manager.cpp

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,30 @@ namespace lfs::vis {
16511651
rm->updateSettings(settings);
16521652
}
16531653

1654+
void SceneManager::finalizeDatasetSceneLoad(
1655+
const std::filesystem::path& dataset_path,
1656+
const std::filesystem::path& scene_path,
1657+
const lfs::core::events::state::SceneLoaded::Type type,
1658+
const size_t num_gaussians,
1659+
const int checkpoint_iteration) {
1660+
{
1661+
std::lock_guard<std::mutex> lock(state_mutex_);
1662+
content_type_ = ContentType::Dataset;
1663+
dataset_path_ = dataset_path;
1664+
}
1665+
1666+
state::SceneLoaded{
1667+
.scene = nullptr,
1668+
.path = scene_path,
1669+
.type = type,
1670+
.num_gaussians = num_gaussians,
1671+
.checkpoint_iteration = checkpoint_iteration}
1672+
.emit();
1673+
1674+
python::set_application_scene(&scene_);
1675+
syncDatasetCameraFrustumsToRenderSettings();
1676+
}
1677+
16541678
std::expected<void, std::string> SceneManager::applyLoadedDataset(
16551679
const std::filesystem::path& path,
16561680
const lfs::core::param::TrainingParameters& params,
@@ -1685,25 +1709,11 @@ namespace lfs::vis {
16851709
services().trainerOrNull()->setTrainer(std::move(trainer));
16861710
}
16871711

1688-
{
1689-
std::lock_guard<std::mutex> lock(state_mutex_);
1690-
content_type_ = ContentType::Dataset;
1691-
dataset_path_ = path;
1692-
}
1693-
16941712
const size_t num_gaussians = scene_.getTrainingModelGaussianCount();
16951713
const auto* point_cloud = scene_.getVisiblePointCloud();
16961714
const size_t num_points = point_cloud ? point_cloud->size() : 0;
16971715

1698-
state::SceneLoaded{
1699-
.scene = nullptr,
1700-
.path = path,
1701-
.type = state::SceneLoaded::Type::Dataset,
1702-
.num_gaussians = num_gaussians}
1703-
.emit();
1704-
1705-
python::set_application_scene(&scene_);
1706-
syncDatasetCameraFrustumsToRenderSettings();
1716+
finalizeDatasetSceneLoad(path, path, state::SceneLoaded::Type::Dataset, num_gaussians);
17071717

17081718
if ((num_gaussians > 0 || num_points > 0) && services().trainerOrNull() && services().trainerOrNull()->getTrainer()) {
17091719
ui::PointCloudModeChanged{.enabled = true, .voxel_size = DEFAULT_VOXEL_SIZE}.emit();
@@ -1782,13 +1792,6 @@ namespace lfs::vis {
17821792
throw std::runtime_error("No trainer manager available");
17831793
}
17841794

1785-
// Update content state
1786-
{
1787-
std::lock_guard<std::mutex> lock(state_mutex_);
1788-
content_type_ = ContentType::Dataset;
1789-
dataset_path_ = path;
1790-
}
1791-
17921795
// Get info from scene
17931796
const size_t num_gaussians = scene_.getTrainingModelGaussianCount();
17941797
const auto* point_cloud = scene_.getVisiblePointCloud();
@@ -1798,15 +1801,7 @@ namespace lfs::vis {
17981801
LOG_INFO("Dataset loaded successfully - {} images, {} initial points/gaussians",
17991802
num_cameras, num_gaussians > 0 ? num_gaussians : num_points);
18001803

1801-
state::SceneLoaded{
1802-
.scene = nullptr,
1803-
.path = path,
1804-
.type = state::SceneLoaded::Type::Dataset,
1805-
.num_gaussians = num_gaussians}
1806-
.emit();
1807-
1808-
python::set_application_scene(&scene_);
1809-
syncDatasetCameraFrustumsToRenderSettings();
1804+
finalizeDatasetSceneLoad(path, path, state::SceneLoaded::Type::Dataset, num_gaussians);
18101805

18111806
state::DatasetLoadCompleted{
18121807
.path = path,
@@ -2029,29 +2024,19 @@ namespace lfs::vis {
20292024
services().trainerOrNull()->setScene(&scene_);
20302025
services().trainerOrNull()->setTrainerFromCheckpoint(std::move(trainer), checkpoint_iteration);
20312026

2032-
{
2033-
std::lock_guard<std::mutex> lock(state_mutex_);
2034-
content_type_ = ContentType::Dataset;
2035-
dataset_path_ = checkpoint_params.dataset.data_path;
2036-
}
2037-
20382027
// Keep the viewer's editable state aligned with the restored trainer state.
20392028
if (auto* param_mgr = services().paramsOrNull()) {
20402029
param_mgr->importTrainingParams(checkpoint_params);
20412030
}
20422031

20432032
LOG_INFO("Checkpoint loaded: {} gaussians, iteration {}", num_gaussians, checkpoint_iteration);
20442033

2045-
state::SceneLoaded{
2046-
.scene = nullptr,
2047-
.path = path,
2048-
.type = state::SceneLoaded::Type::Checkpoint,
2049-
.num_gaussians = num_gaussians,
2050-
.checkpoint_iteration = checkpoint_iteration}
2051-
.emit();
2052-
2053-
python::set_application_scene(&scene_);
2054-
syncDatasetCameraFrustumsToRenderSettings();
2034+
finalizeDatasetSceneLoad(
2035+
checkpoint_params.dataset.data_path,
2036+
path,
2037+
state::SceneLoaded::Type::Checkpoint,
2038+
num_gaussians,
2039+
checkpoint_iteration);
20552040

20562041
ui::PointCloudModeChanged{.enabled = false, .voxel_size = DEFAULT_VOXEL_SIZE}.emit();
20572042
selectNode(MODEL_NAME);

src/visualizer/scene/scene_manager.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ namespace lfs::vis {
264264
private:
265265
void resetToEmptyState(bool trainer_already_cleared = false);
266266
void setupEventHandlers();
267+
void finalizeDatasetSceneLoad(const std::filesystem::path& dataset_path,
268+
const std::filesystem::path& scene_path,
269+
lfs::core::events::state::SceneLoaded::Type type,
270+
size_t num_gaussians,
271+
int checkpoint_iteration = 0);
267272
void syncDatasetCameraFrustumsToRenderSettings();
268273
void syncCropToolRenderSettings(const core::SceneNode* node);
269274
void loadPPISPCompanion(const std::filesystem::path& ppisp_path);

0 commit comments

Comments
 (0)