Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c02e584
Copy to subdirectories of Principia/x64.
pleroy Dec 14, 2025
499ca10
Release script for sse and avx.
pleroy Dec 14, 2025
c766117
New directory structure.
pleroy Dec 14, 2025
66e9694
Typo.
pleroy Dec 14, 2025
b47f33d
Make our windows opaque dark grey.
pleroy Nov 3, 2025
f4b6eca
Cache the style and fix horizontal lines.
pleroy Nov 3, 2025
083a7da
Formatting.
pleroy Nov 3, 2025
a0fdeea
The Principia button only closes the main window.
pleroy Nov 4, 2025
d8982dd
Avoid phantom windows.
pleroy Nov 4, 2025
612f610
Readying.
pleroy Nov 4, 2025
2da6c32
Next release is Laurent
eggrobin Nov 15, 2025
1e0df14
Announce Laplace.
pleroy Nov 19, 2025
20389a5
Remove the external API.
pleroy Dec 6, 2025
cb6e242
Measure the tree and add a focus button for the target vessel.
pleroy Dec 7, 2025
bdf69f2
Only focus in map view.
pleroy Dec 7, 2025
5234dea
Less obnoxious tab.
pleroy Dec 7, 2025
21419a5
Cleanup.
pleroy Dec 7, 2025
e6b7596
Wider columns and a typo.
pleroy Dec 8, 2025
eee5c21
Copy to subdirectories of Principia/x64.
pleroy Dec 14, 2025
e608277
Release script for sse and avx.
pleroy Dec 14, 2025
fe84b43
New directory structure.
pleroy Dec 14, 2025
a820f73
Typo.
pleroy Dec 14, 2025
3cad8da
Merge branch 'Loader' of https://github.com/pleroy/Principia into Loader
pleroy Dec 14, 2025
89a6776
Change OS names.
pleroy Dec 14, 2025
f8d59e0
Loader paths.
pleroy Dec 14, 2025
c8d2556
Merge remote-tracking branch 'mockingbirdnest/master' into DirectoryS…
pleroy Dec 14, 2025
bb58b77
Merge branch 'CPUId' into Loader2
pleroy Dec 14, 2025
849d253
Double DLL load.
pleroy Dec 14, 2025
a865526
More logging.
pleroy Dec 14, 2025
a1769fc
Two-step loading.
pleroy Dec 14, 2025
7d72f1c
Merge branch 'master' into Loader2
pleroy Dec 15, 2025
a52bafe
Need to unload the DLL to avoid confusion about base addresses.
pleroy Dec 16, 2025
95eac50
Make both releases.
pleroy Dec 16, 2025
4e2b8d5
Make both tests.
pleroy Dec 16, 2025
14e1502
Make both cleans.
pleroy Dec 16, 2025
401f490
Allow parallel testing and rebuild all solutions.
pleroy Dec 16, 2025
4b88b0d
Shell syntax.
pleroy Dec 16, 2025
c91559e
Bash.
pleroy Dec 16, 2025
fa452b0
Parallelism.
pleroy Dec 16, 2025
c6602fa
Readying.
pleroy Dec 16, 2025
df20e25
Journal the platform in GetVersion and check it when replaying.
pleroy Dec 16, 2025
e33c136
Principia platform.
pleroy Dec 16, 2025
c8db0fc
Quotes.
pleroy Dec 16, 2025
f38cbe3
GetVersion is not journaled in journal_test because there are two rec…
pleroy Dec 16, 2025
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
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ CXX := clang++
MSBUILD := msbuild
PRINCIPIA_CLANG_VERSION ?= 20
PRINCIPIA_MACOS_VERSION_MIN ?= 13
PRINCIPIA_TARGET ?= x64
ifneq ($(PRINCIPIA_TARGET),x64_AVX_FMA)
ifneq ($(PRINCIPIA_TARGET),x64)
$(error PRINCIPIA_TARGET must be 'x64_AVX_FMA' or 'x64')
PRINCIPIA_PLATFORM ?= x64
ifneq ($(PRINCIPIA_PLATFORM),x64_AVX_FMA)
ifneq ($(PRINCIPIA_PLATFORM),x64)
$(error PRINCIPIA_PLATFORM must be 'x64_AVX_FMA' or 'x64')
endif
endif

Expand Down Expand Up @@ -45,8 +45,8 @@ PROTO_HEADERS := $(PROTO_FILES:.proto=.pb.h)

DEPS_DIRECTORY := deps/

OBJ_DIRECTORY := obj/$(PRINCIPIA_TARGET)/
BIN_DIRECTORY := bin/$(PRINCIPIA_TARGET)/
OBJ_DIRECTORY := obj/$(PRINCIPIA_PLATFORM)/
BIN_DIRECTORY := bin/$(PRINCIPIA_PLATFORM)/
TOOLS_BIN := $(BIN_DIRECTORY)tools

GMOCK_TRANSLATION_UNITS := \
Expand All @@ -68,12 +68,11 @@ ADAPTER_CONFIGURATION := Release
FINAL_PRODUCTS_DIR := Release/
ADAPTER := $(ADAPTER_BUILD_DIR)$(ADAPTER_CONFIGURATION)/ksp_plugin_adapter.dll

# TODO(phl): Change the OS names once the loader is ready.
ifeq ($(UNAME_S),Linux)
PLUGIN_DIRECTORY := $(FINAL_PRODUCTS_DIR)GameData/Principia/Linux64/
PLUGIN_DIRECTORY := $(FINAL_PRODUCTS_DIR)GameData/Principia/Linux/$(PRINCIPIA_PLATFORM)/
endif
ifeq ($(UNAME_S),Darwin)
PLUGIN_DIRECTORY := $(FINAL_PRODUCTS_DIR)GameData/Principia/MacOS64/
PLUGIN_DIRECTORY := $(FINAL_PRODUCTS_DIR)GameData/Principia/macOS/$(PRINCIPIA_PLATFORM)/
endif

TEST_LIBS := \
Expand Down Expand Up @@ -149,9 +148,10 @@ SHARED_ARGS := \
-DPROJECT_DIR='std::filesystem::path("$(PROJECT_DIR)")' \
-DSOLUTION_DIR='std::filesystem::path("$(SOLUTION_DIR)")' \
-DTEMP_DIR='std::filesystem::path("/tmp")' \
-DPLATFORM_WITH_CPU_FEATURES='"$(PRINCIPIA_PLATFORM)"' \
-DNDEBUG

ifeq ($(PRINCIPIA_TARGET),x64_AVX_FMA)
ifeq ($(PRINCIPIA_PLATFORM),x64_AVX_FMA)
SHARED_ARGS += \
-DPRINCIPIA_REQUIRES_AVX=1 \
-DPRINCIPIA_REQUIRES_FMA=1 \
Expand Down
7 changes: 6 additions & 1 deletion include_solution.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir).;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SOLUTION_DIR=std::filesystem::path(R"literal($(SolutionDir))literal");TEMP_DIR=std::filesystem::path(R"literal($(SolutionDir)temp\$(Configuration)\$(Platform)\)literal");%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>
SOLUTION_DIR=std::filesystem::path(R"literal($(SolutionDir))literal");
TEMP_DIR=std::filesystem::path(R"literal($(SolutionDir)temp\$(Configuration)\$(Platform)\)literal");
PLATFORM_WITH_CPU_FEATURES=R"literal($(PlatformWithCPUFeatures))literal";
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
Expand Down
12 changes: 10 additions & 2 deletions journal/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "glog/logging.h"
#include "journal/profiles.hpp" // 🧙 For generated profiles.

#define PRINCIPIA_PLAYER_ALLOW_PLATFORM_MISMATCH 0
#define PRINCIPIA_PLAYER_ALLOW_VERSION_MISMATCH 0

namespace principia {
Expand Down Expand Up @@ -85,12 +86,19 @@ bool Player::Process(std::unique_ptr<serialization::Method> method_in,
method_out_return->GetExtension(serialization::GetVersion::extension)
.out();
LOG_IF(FATAL,
!absl::StartsWith(Version, get_version_out.version()) &&
(PRINCIPIA_PLAYER_ALLOW_VERSION_MISMATCH == 0))
!absl::StartsWith(Version, get_version_out.version()) &&
PRINCIPIA_PLAYER_ALLOW_VERSION_MISMATCH == 0)
<< "Journal version is " << get_version_out.version()
<< ", running with a binary built at version " << Version
<< "; set PRINCIPIA_PLAYER_ALLOW_VERSION_MISMATCH to 1 in player.cpp "
<< "if this is intended.";
LOG_IF(FATAL,
get_version_out.platform() != PLATFORM_WITH_CPU_FEATURES &&
PRINCIPIA_PLAYER_ALLOW_PLATFORM_MISMATCH == 0)
<< "Journal was produced on " << get_version_out.platform()
<< ", running with a binary built for " << PLATFORM_WITH_CPU_FEATURES
<< "; set PRINCIPIA_PLAYER_ALLOW_PLATFORM_MISMATCH to 1 in player.cpp "
<< "if this is intended.";
}

#if 0
Expand Down
2 changes: 1 addition & 1 deletion journal/player_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ TEST_F(PlayerTest, PlayTiny) {
while (player.Play(count)) {
++count;
}
EXPECT_EQ(3, count);
EXPECT_EQ(2, count);
}

TEST_F(PlayerTest, DISABLED_SECULAR_Benchmarks) {
Expand Down
19 changes: 9 additions & 10 deletions journal/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
#include "base/serialization.hpp"
#include "base/version.hpp"
#include "glog/logging.h"
#include "ksp_plugin/interface.hpp"

namespace principia {
namespace journal {
namespace _recorder {
namespace internal {

using interface::principia__GetVersion;
using namespace principia::base::_array;
using namespace principia::base::_hexadecimal;
using namespace principia::base::_serialization;
Expand All @@ -39,16 +41,13 @@ void Recorder::Activate(not_null<Recorder*> const recorder) {

// When the recorder gets activated, pretend that we got a GetVersion call.
// This will record the version at the beginning of the journal, which is
// useful for forensics.
serialization::Method method;
not_null<serialization::GetVersion*> const get_version =
method.MutableExtension(serialization::GetVersion::extension);
active_recorder_->WriteAtConstruction(method);
not_null<serialization::GetVersion::Out*> const out =
get_version->mutable_out();
out->set_build_date(BuildDate);
out->set_version(Version);
active_recorder_->WriteAtDestruction(method);
// useful for forensics. Note that this call doesn't register in the tests of
// the `journal` project, because there we have two `active_recorder`s, the
// one from the test and the one from the DLL.
char const* build_date;
char const* version;
char const* platform;
principia__GetVersion(&build_date, &version, &platform);
}

void Recorder::Deactivate() {
Expand Down
18 changes: 1 addition & 17 deletions journal/recorder_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,8 @@ TEST_F(RecorderTest, Recording) {

std::vector<serialization::Method> const methods =
ReadAll(test_name_ + ".journal.hex");
EXPECT_EQ(6, methods.size());
EXPECT_EQ(4, methods.size());
auto it = methods.begin();
{
EXPECT_TRUE(it->HasExtension(serialization::GetVersion::extension));
auto const& extension =
it->GetExtension(serialization::GetVersion::extension);
EXPECT_FALSE(extension.has_out());
}
++it;
{
EXPECT_TRUE(it->HasExtension(serialization::GetVersion::extension));
auto const& extension =
it->GetExtension(serialization::GetVersion::extension);
EXPECT_TRUE(extension.has_out());
EXPECT_EQ(BuildDate, extension.out().build_date());
EXPECT_EQ(Version, extension.out().version());
}
++it;
{
EXPECT_TRUE(it->HasExtension(serialization::DeletePlugin::extension));
auto const& extension =
Expand Down
8 changes: 6 additions & 2 deletions ksp_plugin/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ using namespace principia::quantities::_si;

namespace {

constexpr char platform_with_cpu_features[] = PLATFORM_WITH_CPU_FEATURES;

constexpr char gipfeli_compressor[] = "gipfeli";

constexpr char base64_encoder[] = "base64";
Expand Down Expand Up @@ -683,10 +685,12 @@ int __cdecl principia__GetVerboseLogging() {

void __cdecl principia__GetVersion(
char const** const build_date,
char const** const version) {
journal::Method<journal::GetVersion> m({build_date, version});
char const** const version,
char const** const platform) {
journal::Method<journal::GetVersion> m({build_date, version, platform});
*CHECK_NOTNULL(build_date) = BuildDate;
*CHECK_NOTNULL(version) = Version;
*CHECK_NOTNULL(platform) = platform_with_cpu_features;
return m.Return();
}

Expand Down
Loading
Loading