frnsys / half_earth

Half-Earth Socialism: The Game, for Half-Earth Socialism (Verso 2022)
GNU Affero General Public License v3.0
39 stars 7 forks source link

Solver crash #171

Closed frnsys closed 2 years ago

frnsys commented 2 years ago

See HALF-EARTH-15 in Sentry

"recursive use of an object detected which would lead to unsafe aliasing in rust"

Using the session playback (session id b5e7f58c-c8cd-3eed-7dfa-be012a538b3e) successfully reproduces the crash:

thread 'main' panicked at 'assertion failed: self.dual_edge_sq_norms[r].is_finite()', /home/ftseng/.cargo/registry/src/github.com-1ecc6299db9ec823/minilp-0.2.2/src/solver.rs:1172:13

   3: minilp::solver::Solver::pivot
   4: minilp::solver::Solver::restore_feasibility
   5: minilp::Problem::solve
   6: half_earth_engine::production::produce
   7: half_earth_engine::state::State::update_demand
frnsys commented 2 years ago

The differences in production orders between the step that works and the one that breaks aren't that big:

"Solar PV" : 2.4107974562588015 %
"Nuclear Power" : 2.4107974562588015 %
"Geothermal" : 0.0 %
"Smallholder Farms" : 1.1307161995317625 %
"BECCS" : 0.0 %
"Fast Breeder Nuclear Power" : 0.0 %
"Cellular Meat" : 0.0 %
"Blue Hydrogen" : 2.4182005346111404 %
"Hydropower" : 2.4107987650679825 %
"Industrial Crop Ag" : 1.1307228795564557 %
"Terrestrial Wind Power" : 2.4107974562588015 %
"Thorium Nuclear Power" : 0.0 %
"Grey Hydrogen" : 0.0 %
"Coal Power Generation" : 2.41079984823705 %
"Organic Livestock Ag" : 0.0 %
"Coal" : 2.4182022441338105 %
"Natural Gas Power Gen" : 2.41079984823705 %
"Industrial Livestock Ag" : 2.021264611776959 %
"Nuclear Fusion" : 0.0 %
"Floating Wind Turbines" : 0.0 %
"Green Hydrogen" : 0.0 %
"Petroleum Power Gen" : 2.4108012020762537 %
"Biofuels" : 2.4182022441339117 %
"Natural Gas" : 2.4182039536564575 %
"Petroleum" : 2.418202244133972 %
"Concentrated Solar Power" : 0.0 %
"Organic Crop Ag" : 1.13072429796757 %
"Algae Biofuels" : 0.0 %
"Vertical Farming" : 0.0 %