Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 30c106069f40
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e5cac82eb16a
Choose a head ref
  • 11 commits
  • 7 files changed
  • 1 contributor

Commits on Jul 17, 2021

  1. Read the save.

    pleroy committed Jul 17, 2021
    Copy the full SHA
    60c085a View commit details
  2. Merge.

    pleroy committed Jul 17, 2021
    Copy the full SHA
    2231e7b View commit details

Commits on Jul 18, 2021

  1. Fix two leaks.

    pleroy committed Jul 18, 2021
    Copy the full SHA
    83ea633 View commit details
  2. Hacks to replay the journal.

    pleroy committed Jul 18, 2021
    Copy the full SHA
    da8f13b View commit details
  3. Copy the full SHA
    c4054f7 View commit details
  4. Copy the full SHA
    a838afa View commit details
  5. Generated files baseline.

    pleroy committed Jul 18, 2021
    Copy the full SHA
    9e863c8 View commit details
  6. Copy the full SHA
    88717d3 View commit details
  7. Remove generated files.

    pleroy committed Jul 18, 2021
    Copy the full SHA
    63ff428 View commit details
  8. Cleanup.

    pleroy committed Jul 18, 2021
    Copy the full SHA
    58ee64e View commit details
  9. Merge pull request #3071 from pleroy/3064

    Fix a number of memory management problems
    pleroy authored Jul 18, 2021
    Copy the full SHA
    e5cac82 View commit details
1 change: 1 addition & 0 deletions astronomy/orbit_ground_track_body.hpp
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ std::vector<Angle> PlanetocentricLongitudes(
DiscreteTrajectory<PrimaryCentred> const& nodes,
RotatingBody<Inertial> const& primary) {
std::vector<Angle> longitudes;
longitudes.reserve(nodes.Size());
for (auto const& node : nodes) {
longitudes.push_back(
CelestialLongitude(node.degrees_of_freedom.position()) -
4 changes: 4 additions & 0 deletions astronomy/orbital_elements_body.hpp
Original file line number Diff line number Diff line change
@@ -144,6 +144,7 @@ OrbitalElements::OsculatingEquinoctialElements(
DegreesOfFreedom<PrimaryCentred> const primary_dof{
PrimaryCentred::origin, PrimaryCentred::unmoving};
std::vector<EquinoctialElements> result;
result.reserve(trajectory.Size());
for (auto const& [time, degrees_of_freedom] : trajectory) {
auto const osculating_elements =
KeplerOrbit<PrimaryCentred>(primary,
@@ -255,6 +256,7 @@ OrbitalElements::MeanEquinoctialElements(
Time ʃ_qʹ_dt;
};
std::vector<IntegratedEquinoctialElements> integrals;
integrals.reserve(osculating.size());
integrals.push_back({t_min});
for (auto previous = osculating.begin(), it = osculating.begin() + 1;
it != osculating.end();
@@ -275,6 +277,7 @@ OrbitalElements::MeanEquinoctialElements(

// Now compute the averages.
std::vector<EquinoctialElements> mean_elements;
mean_elements.reserve(integrals.size());
int j = 0;
for (auto const& up_to_tᵢ : integrals) {
RETURN_IF_STOPPED;
@@ -334,6 +337,7 @@ inline absl::StatusOr<std::vector<OrbitalElements::ClassicalElements>>
OrbitalElements::ToClassicalElements(
std::vector<EquinoctialElements> const& equinoctial_elements) {
std::vector<ClassicalElements> classical_elements;
classical_elements.reserve(equinoctial_elements.size());
for (auto const& equinoctial : equinoctial_elements) {
RETURN_IF_STOPPED;
double const tg_½i = Sqrt(Pow<2>(equinoctial.p) + Pow<2>(equinoctial.q));
3 changes: 2 additions & 1 deletion base/jthread_body.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include "base/jthread.hpp"

#include <set>

#include "base/jthread.hpp"
#include "base/macros.hpp"

namespace principia {
2 changes: 1 addition & 1 deletion journal/player_test.cpp
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ TEST_F(PlayerTest, DISABLED_SECULAR_Debug) {
// An example of how journaling may be used for debugging. You must set
// |path| and fill the |method_in| and |method_out_return| protocol buffers.
std::string path =
R"(P:\Public Mockingbird\Principia\Crashes\2922\JOURNAL.20210312-215639)"; // NOLINT
R"(P:\Public Mockingbird\Principia\Saves\3064\JOURNAL.20210714-175107)"; // NOLINT
Player player(path);
int count = 0;
while (player.Play(count)) {
1 change: 1 addition & 0 deletions ksp_plugin/vessel.cpp
Original file line number Diff line number Diff line change
@@ -640,6 +640,7 @@ void Vessel::AttachPrediction(
if (trajectory->Empty()) {
prediction_ = psychohistory_->NewForkAtLast();
} else {
psychohistory_->DeleteFork(prediction_);
prediction_ = trajectory.get();
psychohistory_->AttachFork(std::move(trajectory));
}
6 changes: 4 additions & 2 deletions serialization/journal.proto
Original file line number Diff line number Diff line change
@@ -207,11 +207,12 @@ message OrbitGroundTrack {

message OrbitAnalysis {
required double progress_of_next_analysis = 1;
optional int32 primary_index = 2;
optional int32 primary_index = 2 [(is_produced) = true];
required double mission_duration = 3;
optional OrbitalElements elements = 4 [(is_produced) = true];
optional OrbitRecurrence recurrence = 5 [(is_produced) = true];
optional OrbitGroundTrack ground_track = 6 [(is_produced) = true];
required fixed64 primary_index_address = 10 [(address_of) = "primary_index"];
required fixed64 elements_address = 7 [(address_of) = "elements"];
required fixed64 recurrence_address = 8 [(address_of) = "recurrence"];
required fixed64 ground_track_address = 9 [(address_of) = "ground_track"];
@@ -780,7 +781,8 @@ message FlightPlanGetCoastAnalysis {
required int32 index = 6;
}
message Return {
required OrbitAnalysis result = 1;
required OrbitAnalysis result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
2 changes: 1 addition & 1 deletion tools/journal_proto_processor.cpp
Original file line number Diff line number Diff line change
@@ -493,7 +493,7 @@ void JournalProtoProcessor::ProcessRequiredFixed64Field(
}
if (Contains(field_cxx_address_of_, descriptor)) {
is_produced = true;
pointer_to = field_cxx_address_of_[descriptor]->message_type()->name();
pointer_to = field_cxx_type_[field_cxx_address_of_[descriptor]];
}
CHECK(!pointer_to.empty()) << descriptor->full_name()
<< " must have exactly one of the (address_of), "