18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 06:35:21 +01:00
Commit Graph

483 Commits

Author SHA1 Message Date
jerrrrycho 885c28c1ef fix: SonarQube findings of the buffer stops
- The notice of a finished hit is taken out of the contact with std::exchange before it goes to the scenery, so
  what the scenery does with it can't reach the one held in the contact.
- The loops count whole steps (an int, the number of steps taken with ceil) instead of adding a floating step.
- The local final of bufferstop::contact() is ending (final is a contextual keyword).

Unit tests 1294/1294.
2026-12-02 17:04:29 +01:00
jerrrrycho 9ecbd110da test: the buffer stops, against their sources and on td.scn
Unit tests of physics/bufferstop.h: the attribute, the brake elements of the
sliding stop (1848 kJ over 8 m), a locomotive shunting into a rigid stop, the
FEM case of Kowalczyk, Enfield, Kirkby, the speeds a stop is ridden up at, the
sliding stop held and overrun, the hydraulic stop, a central coupler, the
independence of the step, the adapter onto collision::hit() and the models of
the automatic rule.

Twelve scenario cases on autotest_stub of td.scn, with the new check
bufferstop of run.py on the log line of a hit.
2026-12-02 12:33:42 +01:00
jerrrrycho bc944b7977 test: the accident bands and Szczekociny for the collisions
Unit tests for the bands of the accident reports and the standards: no
crush at 5 km/h, coaches at 10 km/h and C buffers at 12 km/h buff
without one, a railbus with a crash zone at 36 km/h into an 80 t wagon
doesn't climb (EN 15227), two-car units at 24 km/h don't climb
(Plymouth 2016). The Szczekociny consist checks that the locomotives
crush for metres, the first vehicles of both trains derail and the
coaches behind stay on the rails and coupled. The crushed footprint of
a body off the track is shorter by the crush.

A scenario case re-creates the collision on td.scn and checks which
vehicles leave the rails.

en57_td_crew_parted hits at 140 km/h instead of 100: at 100 km/h the two
ends that meet now take the whole hit and the struck unit stays coupled,
while the case needs it parted for the crew event it tests.
2026-12-02 10:14:10 +01:00
Hirek 304ce934cc Merge pull request #375 from miloszunio/pr/brush
Editor: the brush of models as one model or many in a circle
2026-12-01 23:40:31 +00:00
Hirek 33feccb61b Merge pull request #406 from MaSzyna-EU07/fix/linux-case-extras
fix(files): the files #362 left are found and written in another case on Linux (GE#542)
2026-12-01 23:40:14 +00:00
Hirek fdc77484b8 Merge pull request #566 from MaSzyna-EU07/perf/msvc-release-lto
build: link-time optimization on by default for MSVC Release builds
2026-12-01 23:39:47 +00:00
Hirek b7772203fc Merge pull request #558 from MaSzyna-EU07/fix/sonar-staging-reliability
fix: the five bugs SonarQube Cloud reports on staging (reliability E)
2026-12-01 23:39:12 +00:00
Hirek 9bbbed18f6 Merge pull request #488 from MaSzyna-EU07/fix/inactive-cab-mirrors-flag
fix(vehicle): fold the mirrors of an inactive cab only when InactiveCabFlag says so
2026-12-01 23:38:42 +00:00
Hirek 082f248264 Merge pull request #484 from miloszunio/feat/flashlight-gl46
feat(driver): a flashlight for the player (Ctrl+Shift+F)
2026-12-01 23:37:41 +00:00
Hirek 1b3b92f6af Merge pull request #496 from MaSzyna-EU07/feat/switch-fork-running
feat(physics): a switch thrown under a train runs forked, and may derail it
2026-12-01 23:37:22 +00:00
Hirek 664a864f13 Merge pull request #563 from MaSzyna-EU07/perf/test-mode-hot-paths
perf: faster simulation step, mostly in the test mode (byte-identical results)
2026-12-01 23:35:27 +00:00
Hirek 9d73bb960d Merge pull request #568 from MaSzyna-EU07/test/scenario-runner-longest-first
test(scenarios): longest cases first, -j from the CPU count, utf-8 output
2026-12-01 23:35:02 +00:00
Hirek f71da105f6 Merge pull request #581 from MaSzyna-EU07/fix/derail-coupling-pull-angle
fix(derailment): the coupling off the track pulls hook to hook, not straight across (GH#579)
2026-12-01 23:34:09 +00:00
maj00r ed58a3aab0 Merge pull request #535 from MaSzyna-EU07/feat/model-format-e4d
feat(model): the E4D model format: spec, reader, writer and conversion from E3D/T3D
2026-12-02 00:11:40 +01:00
miloszunio 585e51d140 docs(editor): the brush says rightly what happens when the step of a stroke is gone; the test's generator marked for Sonar (#375)
A correction of 1a6d2bb, whose message and comment were wrong: a stroke whose step is gone from the history didn't crash the
editor and doesn't go on in a step of its own. brush_dab() ends it before the models of the dab, as it did in a87a94d, so
brush_step(true) always has a step in the loop; the null check there is for the analysis (S2259). brush_step() returns null for a
step that is gone without touching the serial, as before 1a6d2bb, and the comments say so.

The helper of the unit test which takes the generator of the test carries the NOSONAR(cpp:S2245) the other ones have: a
repeatable test, not security. Without it the quality gate failed on the security rating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1p6qPUo2Cgx4KaVYU
2026-12-01 22:34:14 +01:00
miloszunio 1a6d2bbc2f fix(editor): the brush keeps its models when the step of the stroke is gone from the history (Sonar)
A stroke held long enough for its step to be trimmed from the history took the step as null and the next model crashed the
editor (Sonar S2259 in editormodebrush.cpp). The rest of the stroke now goes to a step of its own, which Ctrl+Z takes back.

The other notes of the analysis, with no change of behaviour: the fill loops test their counter only and stop on the limit
inside (S886), brush_on_line() is const, the step is found with std::to_address, the line shape of the brush is
shape::along_line (it shadowed the line settings, S1117), and the test of the picks without finite settings is a helper
(S134), with std::numbers::pi in the density test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1p6qPUo2Cgx4KaVYU
2026-12-01 20:29:37 +01:00
jerrrrycho 8ffb74a3b0 test, docs: the buckle case folds less with the coupling pulling hook to hook (GH#579)
eu07_td_off_track_buckle_fast checked that the overturned train comes to
rest folded by 8 deg at least. With the pull of the couplings no longer
across between the buffer faces, they hold the bodies more in line: with
the fixed seed the bends are 1 to 4 deg (3 to 8 before), with the seeds
1 to 6 the largest bend is 7 to 73 deg (21 to 78 before); the same with a
local build of staging and with the CI one. The check takes 3 deg, the
description gives the numbers.

behaviour-changes.md: the coupling off the track pulls hook to hook.
2026-12-01 19:51:07 +01:00
jerrrrycho 4f8b77c474 fix(derailment): the coupling off the track pulls hook to hook, not across between the buffer faces (GH#579)
With physics.derailment new, derail_motion::meet() took the pull of the
coupling along the line between the two buffer faces. Ends side by side,
almost touching along the track and 0.4 m apart across it, gave a line at
80-90 deg to the vehicles, and pull_neighbours() pulled the neighbours off
with Y/Q 1.4-4.3 from a coach that had barely left its line.

A screw coupling hangs between the draw hooks, which swing in the
headstocks behind the buffers. The pull now goes from the hook of one end
to that of the other: the end points moved back along each body's axis by
hook_depth (= buffer_length, 0.6 m; UIC buffers stand 620 mm out of the
headstock). 0.4 m across with the buffers touching gives ~18 deg. In line
nothing changes. Ends gone past each other (gap = distance between the
beams) keep the line between the beams, the way that gap closes: the hook
line turns about there and would hold the bodies with the hooks side by
side, pulling straight across.

gap, push, the buffer path and the point the force acts at are unchanged.
The shares of the force along each vehicle (measure_off_track) follow the
new line too.
2026-12-01 18:58:27 +01:00
jerrrrycho 77affa28d5 fix(files): the files found in another case are counted, and listed only with logs.filecase
These files load fine since #362, so a run no longer gets a log line for each of them. It gets one line with their
count when the game closes, none when there are none; "logs.filecase yes" in eu07.ini logs each name, once, as before.

- The count is written at the closing, as it covers the whole run: the vehicles, sounds and textures loaded after the
  scenery count too, which a line at the end of loading would miss.
- An eu07.ini key rather than a log type of its own: logs.filter sets all the types at once, so a type off by default
  would come on for anyone with "logs.filter 0".
- On Windows nothing is found in another case, so nothing is counted or logged.
2026-12-01 18:24:05 +01:00
jerrrrycho 67a7e3876c fix(files): a new layer isn't made over a file there in another case, and the review's smaller points
- node_layers::create() refuses a name a file is there with in any case: on Linux path() wrote over it.
- A name is marked as logged only once the file is known to be there.
- The log line says the file is on disk in another case; the folders FileOnDiskToWrite() looks up aren't logged.
- The editor start reads the layers, and the heightmap terrain its terrain.yaml and pack files, as they're named on the disk.
- The write test compares the names exactly; a test of the log line once per name, with the lines kept by the test log stub.
2026-12-01 18:24:04 +01:00
jerrrrycho d670cc2e53 fix(files): the files #362 left are found and written in another case on Linux (GE#542)
were still opened by the name the scenery gives, in lowercase, and some were written by it, so on Linux a new file went
to a new lowercase folder next to the real one, or a second file was made next to the one there.

Opened through FileOnDisk() now: the .vmd animations of the events, the Lua script of the scenery, the Lua and WASM
screens and the files they read from their folder, the textures read for the colour of the rails, and the .sbt files a
scenery includes with the terrain directive.

FileOnDiskToWrite() gives the file to write: the one there in any case under its name on the disk, otherwise the name
given in the folders as they are on the disk, the folders missing in any case named as given. The editor's layers
(node_layers::path()), the .sbt the game writes and the heightmap terrain folder go through it; the editor removes an
.sbt there in another case. The .e3d made of a .t3d is written next to the text, or over the .e3d there in another case.

FileCased() writes each file found only in another case to the log once (logtype::file), the list for the authors of
the data to name the files as they're asked for.

Nothing changes on Windows: FileCased() gives the name back as it is there, and nothing is logged.
2026-12-01 18:23:24 +01:00
jerrrrycho a1a988d753 test: the trains of the hose exchange kept from one step to the next against ones worked out in every step
One train, a locomotive with five freight wagons on a gradient, stepped twice from the same seed: as the game
steps it, the trains of the hoses kept in the cache, and with them worked out again in every step
(test::consist::keep_hose_trains(false)). Charged, braked, the last two wagons uncoupled, released: with
Global.physics_sleepheld the wagons held by their brakes fall asleep and wake on the way, so the trains change
with the uncoupling and with the vehicles going to sleep and waking. The pipes, the reservoirs of the hoses and
the brake cylinders of the two are bitwise the same after every step. A cache which is never laid out again
after its first step fails it (10203 differences).
2026-12-01 17:28:55 +01:00
jerrrrycho c45700d253 test(scenarios): the second coach derails forked first, its neighbours then pulled off
eu07_td_switch_thrown_facing_behind_derails failed on its on_track check:
once c2 derails running forked, the off-track motion of #451 takes its
ends, 0.4 m to the side of the coaches next to it, as a pull across them
(80-88 deg, Y/Q 1.4-4.3) and pulls c1 and c3 off, and c1 the locomotive.
The case now checks what the fork does: c2 derails first, with nothing
derailed or off the track before it in the log, it leaves the track
upright (flange climbed), and the train stops. log_lacks takes an
optional before pattern for that.
2026-12-01 17:27:32 +01:00
jerrrrycho b490d6a49d build: link-time optimization for the unit tests too, reword the USE_LTO comment
eu07_unit_tests links eu07_core, which USE_LTO compiles with /GL; without the property on the test
target MSVC met those objects in a link without /LTCG and restarted the link with it, after a warning.
INTERPROCEDURAL_OPTIMIZATION_RELEASE is now set on the test target too.
2026-12-01 16:58:17 +01:00
jerrrrycho 4a7eab6e13 test: the copy of the thread's engine marked as the simulation's randomness for Sonar (S2245) 2026-12-01 16:57:52 +01:00
jerrrrycho 5b1bbd7a09 test(scenarios): at most 2 slow cases at once with the default -j
With --slow and the default -j (half the logical CPUs) the five slow cases that don't have to run alone
started together, longest first, up to 5 x 2.4 GB at the start of the run. Without -j at most 2 of them
now run at once; the other places take the short cases meanwhile, in the same longest-first order. A -j
given on the command line lifts the limit. "started" is printed when a case really starts.

README: the slow wrzosy_pxe336080_couples still runs alone after all the others.
2026-12-01 16:56:57 +01:00
Hirek 1ae8fdc62a Merge pull request #560 from MaSzyna-EU07/fix/derailment-ground-556
fix(derailment): no fall through the ground off the track, and more friction on it (#556)
2026-12-01 10:07:17 +00:00
miloszunio a87a94d36d fix(editor): the brush after the review of 30.11: a second uniform stroke doubles nothing, the step of a stroke by its serial
- the uniform fill is told of the models which stand near the dab already (scatter::dab(), Standing) and leaves the points of
  its grid alone where one stands: a second stroke over the same ground adds nothing, as the description says. After a Ctrl+Z
  of the first the ground is filled again
- the step of the history of a stroke is made with its first model and looked up by its serial for each model
  (editor_mode::brush_step()): a step pushed while the button is held (Del) no longer takes the later models of the stroke,
  and a press which puts nothing (on the sky, no model chosen) leaves the steps to redo as they were
- the settings of the brush are bounded before they are used (scatter: sane()): a number typed into a field which isn't
  finite gives no place nor transform which isn't, and the fields clamp what is typed (ImGuiSliderFlags_AlwaysClamp).
  Within the ranges of the panel nothing changes
- tests: the second stroke, the settings which aren't numbers, the ranges of the panel
- redo_last() ends the stroke after the step of the terrain, and tests/unit/CMakeLists.txt lists editorScatter.cpp apart from
  the lines #311, #430 and #431 add, so the four merge without a conflict
2026-11-30 22:16:26 +00:00
miloszunio 1e3c9b9c40 fix(driver): the flashlight after the review of 30.11: the toggle in a helper, a line in the log with the clustered lights off
- TCamera::OnCommand() hands the command to toggle_flashlight(), which keeps the complexity of the handler where it was (S3776)
- turned on with gfx.lights.clustered off the flashlight lights nothing: the log says so
- local_lights::add_flashlight() is private; gather() adds the flashlight right after the lights of the cab, apart from the
  place the arcs of the pantographs of #431 are added in, so the two merge without a conflict
- a test of the toggle: the key going up switches it, a press and the repeats don't
2026-11-30 22:01:30 +00:00
Hirek 4c30fe4c3b Merge pull request #569 from MaSzyna-EU07/fix/snow-layer-driver-crash
Fix/snow layer driver crash
2026-11-30 19:04:16 +00:00
Hirek 01893ded61 Merge pull request #547 from MaSzyna-EU07/feat/derailment-event
A derailment is told to the scenery and ends a test run on request
2026-11-30 18:59:42 +00:00
Hirek 40a39ad390 Merge branch 'staging' of https://github.com/MaSzyna-EU07/maszyna into fix/snow-layer-driver-crash 2026-11-30 19:40:15 +01:00
Hirek 48b7c679a0 Windscreen snow: no crash of the simulator when the driver's compiler faults
A player's simulator (Vulkan, GeForce RTX 4060, NVIDIA 610.88, through Steam) crashed at every start
as the cab loaded: an access violation (read of address 8) inside nvgpucomp64.dll while
vkCreateComputePipelines compiled water_snowlayer.comp. The crash came on $baltyk_skm1.scn and $td.scn
alike, at the same address in the driver.

The snow shaders (shaders/vk14 and shaders/ogl46, the same in both) no longer use what the
compute shader alone had: a vector component written at an index known only while running through an
inout parameter (snRef), constant arrays of structs and of ints indexed at run time (sn_grids,
sn_lump_tiles, the neighbours of snSpan) and a local vec4 indexed by the blade. They are worked out by
small functions and explicit components instead (snRefPut, snRefWord, snGrid, snLumpTile, snNear),
and the blade is read from the storage as water_snow.comp, which the same driver compiled, does.
The results are the same. glslc compiles both variants and spirv-val passes; whether 610.88 compiles
them now can't be checked without that driver.

So that a driver crashing on a program the renderer can go without doesn't take the simulator down,
the programs of the windscreen water are made under gfx::DriverCrashGuard
(rendering/common/drivercrashguard.*):
- with msvc the fault of the driver is caught (SEH) and the session goes on without the program: the
  glasses without the snow, or without the simulation of the water;
- the program is written down in the cache of the renderer (driver_crash_attempt.txt) before the driver
  gets it and crossed out after. a program a session ended on is suspect (driver_crash_suspects.txt);
  when a second session ends on it, or when a fault was caught, it is recorded (driver_crashes.txt) and
  not made again with that driver. a new driver or a changed program is tried again;
- Vulkan makes these pipelines without the VkPipelineCache, whose lock a faulting driver might leave
  taken (the drivers keep their own cache on the disk).

Tested: unit tests (1211/1211, with a caught access violation), Vulkan and OpenGL 4.6 in the cab of
303E on $td.scn (RTX 4070, 621.14), and on Vulkan with a real access violation injected into the
pipeline of water_snowlayer.comp: the session went on without the snow, the next one skipped it.

No change of the game data.
2026-11-30 19:39:29 +01:00
jerrrrycho bdf951dd21 test(scenarios): longest cases first, -j from the CPU count, utf-8 output
With -j the cases started in name order, so a mission marked slow (up to 25 minutes) could start
last and run on alone long after the short cases were done. The cases now start longest first:
slow ones, then by timeout and duration.

-j defaults to half the logical CPUs, about the physical cores (1 with --watch). On 6 cores /
12 threads the 86 cases that aren't slow took 449 s with -j 1, 89 s with -j 4, 73 s with -j 6
and 88 s with -j 8; all 92 with --slow -j 6 took 31 minutes. Verdicts and .dat files were the
same as with -j 1 in every run.

stdout and stderr are written as utf-8: with the output redirected to a file, a case description
with a character outside the console's code page stopped the run with UnicodeEncodeError.
2026-11-30 18:47:42 +01:00
Hirek 7d3ccd6dc4 Textures: read KTX2 files (BC1-BC7, RGBA8, zstd) in both renderers
The game now reads .ktx2 texture files, for the OpenGL 4.6 and the Vulkan
renderer alike (texture_source::load_KTX2(), parser in model/ktx2.*):

- formats: BC1 (RGB and RGBA), BC2, BC3, BC4, BC5 (unsigned and signed),
  BC6H (unsigned and signed float), BC7, and plain R8G8B8A8 / B8G8R8A8;
- the levels stored as they are or packed with zstd (the bundled zstd);
  with gfx.textures.streaming the worker threads read and unpack them;
- the KTXorientation key is honoured: "rd" files are flipped to the bottom
  row first, BC1-BC5 block by block, plain texels row by row. BC6H and BC7
  can't be flipped without decoding: an "rd" file of these is loaded as
  stored, with a warning in the log, as the BC7 dds files are. A file
  without the key is taken the way the dds files are (ddsupperorigin);
- srgb or linear colour is chosen by the material, as for the dds files;
- the alpha of BC7 is checked on a small level, as for the dds files.

Not supported, refused with the reason in the log: Basis Universal
(ETC1S / UASTC, BasisLZ), zlib supercompression, arrays, cube maps and
3d images.

BC1 without alpha, BC4, BC5 and BC6H are new formats for the renderers:
opengl_texture::mapping and the Vulkan texture_format_of() map them (no
srgb variants for BC4/BC5/BC6H; their alpha reads 1).

.ktx2 is looked for right after .dds (textures, materials, the editor's
texture browsers). Existing data holds no .ktx2 files, so nothing changes
for existing sceneries and vehicles, and no asset change in the SVN is
needed.

Unit tests: tests/unit/test_ktx2.cpp (header, levels, zstd, orientation,
refused files, flipping of BC1-BC5 and plain texels).
2026-11-30 15:08:45 +01:00
miloszunio cb3ac22a8d fix(editor): a stroke of the brush leaves the density set on the ground it goes over
The density of the random and the feathered fills was counted for the whole circle of every dab. The
circles of a stroke overlap (a dab every half of the radius), so each place got its share from every
dab that went over it: 5 models a 100 m² set came to some 15 on the ground, and more wherever the
cursor came back. The count was also rounded for each dab, so a circle too small for half a model
(1 m at 4 a 100 m²) never got any.

A stroke now keeps the circles of its dabs beside the places of its models (scatter::stroke). A dab
draws as many places as the density asks for in its circle and keeps each with the chance of what
the ground there is short of: nothing where an earlier dab of the stroke has filled it, so the
overlaps and the way back add no more. The count is the whole part of what is asked for and one more
with the chance of its fraction, so small circles and low densities get their share over the stroke.
The feathered fill is as dense as set in the middle of the stroke and thins out towards its edge;
a single dab of it used to squeeze the whole count of the circle into its middle.

The uniform fill (the grid) is as it was. The tooltip of the density says what it counts.
2026-11-30 12:20:57 +00:00
miloszunio 71bd8d95f4 merge: staging (6a716b67) into pr/brush: the brush kept beside the track names list in CMakeLists.txt, the unit tests and editor_pl.po 2026-11-30 12:10:29 +00:00
jerrrrycho 89de7380ee perf(physics): the trains of the hose exchange are kept from one step to the next
exchange_through_hoses() worked out on every call which vehicles the brake and the main reservoir hoses
join into trains (hose_trains(): the list sorted by address, a search through the couplers), and laid
them out train by train: ~2.7% of the main thread on Tomaszewo, for trains which change only with a
coupling, a vehicle going to sleep or waking up, or one added or taken away.

vehicle_table::update_brake_pipes(), which passes all the vehicles of the scenery in every step, now
keeps them in a physics::hose_trains_cache (physics/components/hosetrains.h) together with what they
were worked out from: of each vehicle of the list, whether it stepped the pipe and the neighbour the
hose of each end joins it to. On every step that is gathered again (one pass over the list) and
compared: the trains are worked out again unless it's all the same, so they're always the ones
hose_trains() gives. The groups stepped in parallel (update_steps_parallel()) and
physics::Vehicle::UpdatePipeCouplers() work them out on each call as before. hose_substeps() goes by
the pressures, which change in every step, and is left as it is.

The unit tests' consist steps its brake pipes the way update_brake_pipes() does now, with the trains
kept, so the golden traces (recorded on staging) check the kept trains, the uncouplings of the tests
included.

600 s in --test, seed 12345, one run each: Tomaszewo (raj40821) sim 134.9 s against 137.4 s the step
before (-1.8%); L107 (linia_107_objazdy) sim 18.1 s against 18.8 s. The physics logs (14 and 9) and the
event logs are byte-identical to staging's, unit tests 1207/1207 with exact golden traces.
2026-11-30 09:01:34 +01:00
jerrrrycho 3b6c60964e fix(derailment): the slope of the bed goes on down to the terrain; the toe only bounds it where there's none
The toe limited the slope of the bed everywhere, so beside an embankment higher than 3 m the bed was a
floor in mid-air 3 m under the ballast, over the field (review of #560). formation::height() is the
slope again, unbounded; reaches() alone bounds the bed where the terrain has no ground under the point.

The zigzag test runs 32 seeds instead of 8 (23 trains fold, 14 pairs of folds, 8 of them opposite
ways), so that one seed folding otherwise doesn't decide it.
2026-11-30 08:15:52 +01:00
jerrrrycho aa9fc1b6f3 perf(physics): the engine of a group of vehicles stepped in parallel is seeded at its first draw
vehicle_table::update_steps_parallel() gives each group of vehicles an engine of Random() of its own,
seeded from the run's engine and the group, so the draws are the same whichever thread takes the
group. It built a std::mt19937 from a std::seed_seq for every group in every step: seed_seq::generate
filling the 624 words of the state was 2.4% of the main thread and most of what the worker threads did
(5263 of their non-waiting samples) on Tomaszewo, where most groups (parked wagons, cars) draw nothing.

The group now gets a lazy_random_engine (utilities/lazyrandom.h) holding the two numbers, which
Random() seeds the same way (std::seed_seq of the two) at the group's first draw. A group that draws
gets the same numbers as before, one that doesn't skips the seeding. Ported from a local branch of
2026-11-28 (perf/parallel-group-random-engine-lazy-seed, on the layout before #531), with its tests:
the lazy engine draws as one seeded up front from the same numbers, is seeded at the first draw only,
and stands ahead of the thread's engine while it's set.

600 s in --test, seed 12345, one run each: Tomaszewo (raj40821) sim 151.5 s against 206.7 s the step
before (-27%); L107 (linia_107_objazdy, binary terrain, gfxrenderer null) sim 20.5 s against 31.1 s.
The physics logs (14 and 9) and the event logs are byte-identical to staging's, unit tests 1207/1207
with exact golden traces.
2026-11-30 08:15:16 +01:00
jerrrrycho 597d72fdf9 test, docs: the derailment cases and the behaviour changes with the new friction on the ground (GH#556) 2026-11-30 03:02:47 +01:00
jerrrrycho f0d3cfbd98 test(derailment): the deceleration on its side and the zigzag of a folded train with the new friction 2026-11-30 02:33:37 +01:00
jerrrrycho 551172f9db test(derailment): the expectations of the friction on the ground follow its new values 2026-11-30 02:08:01 +01:00
jerrrrycho d1e08078f1 fix(derailment): no fall through the ground off the track, and more friction on it (GH#556)
physics.derailment new: a vehicle off the track takes the ground from the
terrain of the scenery and from the bed of the track. Where the terrain had
no ground under a support (a hole in it, past the edge of what was gathered),
the slope of the bed was taken, and it went down for ever: 100 m off the track
some 65 m. The vehicle fell into it, and once under the terrain it never found
the terrain again, as that was over it (a ceiling of 1 m over the vehicle).
The slope now ends at its toe, 3 m under the top of the ballast, and away
from it, where the terrain says nothing, there's no ground: the vehicle keeps
its height.

The friction of a vehicle sliding off the track goes from 0.3 to 0.45 on its
wheels and from 0.5 to 0.7 on its side: a train off the track at 130-150 km/h
slid some 250 m.
2026-11-30 01:03:54 +01:00
maj00r 6a716b6720 Merge pull request #533 from MaSzyna-EU07/fix/wiperlist-bytesum-parse
Read the WiperList wiper mask as a number, not a character
2026-11-30 00:41:27 +01:00
maj00r fc74ff0860 Merge origin/staging into feat/model-format-e4d 2026-11-30 00:32:49 +01:00
jerrrrycho 7eb73ad9d4 fix: the five bugs SonarQube Cloud reports on staging (reliability E)
- application/driveruipanels.cpp (S3584, blocker): the UART section of the
  debug panel leaked a new char*[] of the port names every frame it was open;
  the names go through a vector now.
- rendering/vulkan14/vulkan14swapchain.cpp (S1048): the destructor called
  destroy(), whose release_images() keeps the presentation semaphores in a
  vector and may throw on allocation; the destructor catches it.
- rendering/vulkan14/vulkan14scene.cpp (S2259): walk_shadow_material()
  dereferenced m_context, which own_shadow_program() just before treats as
  possibly empty; it returns without a context.
- tests/unit/test_door_component.cpp, test_consist_braking.cpp (S2193): the
  float loop counters become while loops summing the same time, so the cases
  take exactly the steps they took before.
2026-11-30 00:29:19 +01:00
jerrrrycho a81d149541 feat: a memory cell of its own for the derailment of a vehicle
report_derailment() writes the memory cell at once and only queues the
events, which run later in Events.update(). A collision derails both
vehicles in one frame, so when <A>:derailed ran, __simulation.derailment
already held B. The scenery can now declare the memory cell
<vehicle>:derailed, written the same way and with the same three fields
as __simulation.derailment, for the events of that one vehicle to read.

Documented that __simulation.derailment keeps only the last derailment
of a frame; eu07_td_off_track_end_scenery_told checks the cell of the
locomotive now.
2026-11-30 00:15:50 +01:00
jerrrrycho 61aaaa7c62 Merge staging into feat/derailment-event
# Conflicts:
#	physics/derailment.cpp
#	physics/derailment.h
#	tests/scenarios/README.md
#	tests/unit/test_derailment.cpp
2026-11-30 00:12:29 +01:00
Hirek f964f75ece Merge pull request #544 from MaSzyna-EU07/fix/staging-case-regressions
Fix two scenario cases broken on staging: the uuid of scene nodes, the AI stop on a gradient, an off-track coupling
2026-11-29 17:35:36 +00:00