Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CR] Catch weariness fluctuations #47273

Closed

Conversation

actual-nh
Copy link
Contributor

@actual-nh actual-nh commented Feb 6, 2021

Summary

Infrastructure "Catch weariness fluctuations during testing"

Purpose of change

As seen in #46384 and elsewhere (e.g., some test failures in #46941), there are some unintuitive changes in weariness level:

  • going up while resting; and/or
  • going down while continuously working.

Further information on this, and any differences between platforms, is desirable, particularly since most of the information is from before #46906.

Describe the solution

This PR adds one set of tests (more will likely be added) to catch these fluctuations. It also uses some from #46473 to extract more detailed information. (I have not submitted the latter as a separate, non-draft PR partially because they will hopefully be superseded by an added function in #45316.)

Expansion of the available tests to include ones for, simply, "did weariness level go down ever" and similar is planned for the 8, 12, and 24-hour digging tasks.

For the future, figuring out exactly what it is reasonable (intuitive) to expect from the 1 day vehicle work weary_recovery task is a question of interest.

Additional context

Example test result from running cata_test --rng-seed 'time' weary_recovery locally:

Randomness seeded to: 1612642312

-------------------------------------------------------------------------------
weary_recovery
  Heavy tasks
-------------------------------------------------------------------------------
../tests/weary_test.cpp:120
...............................................................................

../tests/weary_test.cpp:130: FAILED:
  CHECK( info.transition_minutes( 1, 0, 0_minutes ) > ( 8 * 60 ) )
with expansion:
  120 > 480 (0x1e0)
with messages:
  
Digging Pits 8 hours, then waiting 8:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
  Transition: Weary lvl 0 to 1 at 115 min (W 1060 Th 1019 Tr 1380 In 639)
  Transition: Weary lvl 1 to 0 at 120 min (W 1006 Th 1020 Tr 1428 In 843)
  Transition: Weary lvl 0 to 1 at 125 min (W 1066 Th 1019 Tr 1488 In 843)
  Transition: Weary lvl 1 to 2 at 250 min (W 2011 Th 1000 Tr 2688 In 1353)
  Transition: Weary lvl 2 to 3 at 360 min (W 2724 Th 983 Tr 3478 In 1507)
  Transition: Weary lvl 3 to 4 at 470 min (W 3209 Th 968 Tr 3984 In 1549)
  Transition: Weary lvl 4 to 3 at 520 min (W 3095 Th 960 Tr 3856 In 1521)
  Transition: Weary lvl 3 to 2 at 640 min (W 2533 Th 944 Tr 3248 In 1429)
  Transition: Weary lvl 2 to 3 at 665 min (W 2590 Th 941 Tr 3273 In 1366)
  Transition: Weary lvl 3 to 2 at 670 min (W 2432 Th 940 Tr 3115 In 1366)
  Transition: Weary lvl 2 to 1 at 880 min (W 1748 Th 911 Tr 2351 In 1205)
  Weariness: 1651 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1722 Intake: 1093 Tracker: 2198 Thresh: 901 At: 1
  Cal: 52522/55000 Fatigue: 192 Morale: 0 Wgt: 74906 (BMI 24.5)

../tests/weary_test.cpp:133: FAILED:
  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
with expansion:
  665 (0x299) <= 480 (0x1e0)
with messages:
  
[duplicate of the above]

Log messages during failed test:
12:00:00AM: You eat your holy SPAM of debugging (fresh).
12:00:00AM: You start walking.
12:00:00AM: You eat your holy SPAM of debugging (fresh).
12:00:00AM: You start walking.
-------------------------------------------------------------------------------
weary_recovery
  1 day vehicle work
-------------------------------------------------------------------------------
../tests/weary_test.cpp:138
...............................................................................

../tests/weary_test.cpp:147: FAILED:
  CHECK( info.transition_minutes( 2, 1, 740_minutes ) == Approx( 740 ).margin( 5 ) )
with expansion:
  750 (0x2ee) == Approx( 740.0 )
with messages:
  
3 meals, 10h vehicle work, 4h reading, 10h sleep, 16h waiting
  Weariness: 1651 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1722 Intake: 1093 Tracker: 2198 Thresh: 901 At: 1
  Cal: 52522/55000 Fatigue: 192 Morale: 0 Wgt: 74906 (BMI 24.5)
  Transition: Weary lvl 0 to 1 at 325 min (W 1029 Th 1019 Tr 1440 In 821)
  Transition: Weary lvl 1 to 2 at 620 min (W 1957 Th 970 Tr 2784 In 1653)
  Transition: Weary lvl 2 to 1 at 750 min (W 1904 Th 955 Tr 2766 In 1724)
  Transition: Weary lvl 1 to 2 at 755 min (W 1910 Th 954 Tr 2772 In 1724)
  Transition: Weary lvl 2 to 1 at 770 min (W 1789 Th 952 Tr 2651 In 1724)
  Transition: Weary lvl 1 to 0 at 995 min (W 893 Th 942 Tr 1787 In 1819)
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1729 Intake: 850 Tracker: 0 Thresh: 1061 At: 0
  Cal: 53566/55000 Fatigue: -1000 Morale: 3 Wgt: 75604 (BMI 24.7)

Log messages during failed test:
4:03:12 PM: You eat your holy SPAM of debugging (fresh).
4:03:12 PM: You start walking.
4:03:12 PM: You eat your smoked sausage (fresh).
4:03:12 PM: You eat your smoked sausage (fresh).
4:03:12 PM: You drink your milk (fresh).
4:03:12 PM: You drink your milk (fresh).
4:03:13 PM: You feel quite full, and a bit sluggish.
9:09:13 PM: You eat your smoked sausage (fresh).
9:09:13 PM: You eat your smoked sausage (fresh).
9:09:13 PM: You drink your milk (fresh).
9:09:13 PM: You drink your milk (fresh).
9:09:14 PM: You feel quite full, and a bit sluggish.
2:15:14 AM: You eat your smoked sausage (fresh).
2:15:14 AM: You eat your smoked sausage (fresh).
2:15:14 AM: You drink your milk (fresh).
2:15:14 AM: You drink your milk (fresh).
2:15:15 AM: You feel quite full, and a bit sluggish.
6:21:03 AM: You fall asleep.
===============================================================================
test cases:  1 |  0 passed | 1 failed
assertions: 14 | 11 passed | 3 failed

BTW, the duplicate messages re "holy SPAM of debugging" and "you start walking" are from clear_avatar being called both right before and right after invocation of debug_weary_info - see #46941.

Give more detailed information on weariness (tracker and intake),
to try to figure out why keeps going up and down during tests.

Since the "healthy" stored calories are at bmi 25, put calories
to healthy minus debug_nutrition, to prevent going over.

(cherry picked from commit b897540)
The caloric subtraction (minus calories for debug_nutrition) is causing
errors in other tests, and it is also desirable to make sure it isn't
doing anything to the weariness tests themselves (weary intake).

With the new information (weary tracker and intake), the summarize
transition output is linewrapping; trying to prevent.

(cherry picked from commit e967767)
Start on adding tests for unrealistic fluctuations in weary level;
see CleverRaven#46384 (and some cases in CleverRaven#46941) for example problems. The initial
tests look for problems with the weary_recovery task of digging for 8
hours then waiting for 8 hours; weary level should not go down in the
first 8 hours, and should not go up in the second 8 hours.
@actual-nh
Copy link
Contributor Author

actual-nh commented Feb 6, 2021

The failure for the General Build Matrix (GCC 7, Ubuntu, Tiles, CMake) is indeed from one of the added tests:

(~[slow] ~[.])=>	Randomness seeded to: 1612647116
(~[slow] ~[.])=>	
(~[slow] ~[.])=>	-------------------------------------------------------------------------------
(~[slow] ~[.])=>	weary_recovery
(~[slow] ~[.])=>	  Heavy tasks
(~[slow] ~[.])=>	-------------------------------------------------------------------------------
(~[slow] ~[.])=>	/home/runner/work/Cataclysm-DDA/Cataclysm-DDA/tests/weary_test.cpp:121
(~[slow] ~[.])=>	...............................................................................
(~[slow] ~[.])=>	
(~[slow] ~[.])=>	/home/runner/work/Cataclysm-DDA/Cataclysm-DDA/tests/weary_test.cpp:134: FAILED:
(~[slow] ~[.])=>	  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
(~[slow] ~[.])=>	with expansion:
Error: (~[slow] ~[.])=>	  660 (0x294) <= 480 (0x1e0)
(~[slow] ~[.])=>	with messages:
(~[slow] ~[.])=>	  
(~[slow] ~[.])=>	Digging Pits 8 hours, then waiting 8:
(~[slow] ~[.])=>	  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
(~[slow] ~[.])=>	  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
(~[slow] ~[.])=>	  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
(~[slow] ~[.])=>	  Transition: Weary lvl 0 to 1 at 125 min (W 1078 Th 1019 Tr 1500 In 843)
(~[slow] ~[.])=>	  Transition: Weary lvl 1 to 2 at 250 min (W 2023 Th 1000 Tr 2700 In 1353)
(~[slow] ~[.])=>	  Transition: Weary lvl 2 to 3 at 360 min (W 2735 Th 983 Tr 3489 In 1507)
(~[slow] ~[.])=>	  Transition: Weary lvl 3 to 4 at 470 min (W 3220 Th 967 Tr 3995 In 1549)
(~[slow] ~[.])=>	  Transition: Weary lvl 4 to 3 at 520 min (W 3105 Th 960 Tr 3866 In 1521)
(~[slow] ~[.])=>	  Transition: Weary lvl 3 to 2 at 640 min (W 2542 Th 944 Tr 3257 In 1429)
(~[slow] ~[.])=>	  Transition: Weary lvl 2 to 3 at 660 min (W 2594 Th 941 Tr 3277 In 1366)
(~[slow] ~[.])=>	  Transition: Weary lvl 3 to 2 at 670 min (W 2440 Th 940 Tr 3123 In 1366)
(~[slow] ~[.])=>	  Transition: Weary lvl 2 to 1 at 875 min (W 1753 Th 911 Tr 2356 In 1205)
(~[slow] ~[.])=>	  Weariness: 1661 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
(~[slow] ~[.])=>	  BMR: 1721 Intake: 1093 Tracker: 2208 Thresh: 900 At: 1
(~[slow] ~[.])=>	  Cal: 52504/55000 Fatigue: 193 Morale: 0 Wgt: 74894 (BMI 24.5)
(~[slow] ~[.])=>	
(~[slow] ~[.])=>	Log messages during failed test:
(~[slow] ~[.])=>	12:07:12AM: You eat your holy SPAM of debugging (fresh).
(~[slow] ~[.])=>	12:07:12AM: You start walking.
(~[slow] ~[.])=>	12:07:12AM: You eat your holy SPAM of debugging (fresh).
(~[slow] ~[.])=>	12:07:12AM: You start walking.

Analysis (of both this and the local one in the PR):

  • This instance did not have the (while digging) 1->0 fluctuation seen in local testing (above). It did, however, have the second fluctuation (2->3).
  • The 1->0 fluctuation seen locally appears to be purely from the intake going up (absorption of food from the guts); see Remove randomness from metabolism #46906 and others for some discussion of this (which I would characterize as near-hypoglycemic...).
  • The 2->3 fluctuation is at least partially from the intake variable - but (something I did not notice previously) not purely; there is also an unexpected increase in the tracker variable (3257 to 3277), during a rest period. It is admittedly only by 20-25 kcal; however, it really should not be happening at all. (If it were due to basal metabolic rate still consuming some calories, it should be rather more spread out in its effects!)

@actual-nh
Copy link
Contributor Author

Appveyor result is consistent:

weary_recovery
  Heavy tasks
-------------------------------------------------------------------------------
C:\Projects\Cataclysm-DDA\tests\weary_test.cpp(121)
...............................................................................
C:\Projects\Cataclysm-DDA\tests\weary_test.cpp(134): FAILED:
  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
with expansion:
  660 (0x294) <= 480 (0x1e0)
with messages:
  
Digging Pits 8 hours, then waiting 8:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
  Transition: Weary lvl 0 to 1 at 125 min (W 1078 Th 1019 Tr 1500 In 843)
  Transition: Weary lvl 1 to 2 at 250 min (W 2023 Th 1000 Tr 2700 In 1353)
  Transition: Weary lvl 2 to 3 at 360 min (W 2735 Th 983 Tr 3489 In 1507)
  Transition: Weary lvl 3 to 4 at 470 min (W 3220 Th 967 Tr 3995 In 1549)
  Transition: Weary lvl 4 to 3 at 520 min (W 3105 Th 960 Tr 3866 In 1521)
  Transition: Weary lvl 3 to 2 at 640 min (W 2542 Th 944 Tr 3257 In 1429)
  Transition: Weary lvl 2 to 3 at 660 min (W 2594 Th 941 Tr 3277 In 1366)
  Transition: Weary lvl 3 to 2 at 670 min (W 2440 Th 940 Tr 3123 In 1366)
  Transition: Weary lvl 2 to 1 at 875 min (W 1753 Th 911 Tr 2356 In 1205)
  Weariness: 1661 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1721 Intake: 1093 Tracker: 2208 Thresh: 900 At: 1
  Cal: 52504/55000 Fatigue: 193 Morale: 0 Wgt: 74894 (BMI 24.5)
Log messages during failed test:
12:07:12AM: You eat your holy SPAM of debugging (fresh).
12:07:12AM: You start walking.
12:07:12AM: You eat your holy SPAM of debugging (fresh).
12:07:12AM: You start walking.

@actual-nh
Copy link
Contributor Author

actual-nh commented Feb 7, 2021

A local run with weary_recovery after both weary_24h_tasks and weary_assorted_tasks gives an almost identical result (with regard to weary_recovery) to the Appveyor run:

weary_recovery
  Heavy tasks
-------------------------------------------------------------------------------
../tests/weary_test.cpp:120
...............................................................................

../tests/weary_test.cpp:133: FAILED:
  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
with expansion:
  660 (0x294) <= 480 (0x1e0)
with messages:
  
Digging Pits 8 hours, then waiting 8:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
  Transition: Weary lvl 0 to 1 at 125 min (W 1078 Th 1019 Tr 1500 In 843)
  Transition: Weary lvl 1 to 2 at 250 min (W 2023 Th 1000 Tr 2700 In 1353)
  Transition: Weary lvl 2 to 3 at 360 min (W 2737 Th 983 Tr 3491 In 1507)
  Transition: Weary lvl 3 to 4 at 470 min (W 3208 Th 968 Tr 3997 In 1577)
  Transition: Weary lvl 4 to 3 at 520 min (W 3107 Th 960 Tr 3868 In 1521)
  Transition: Weary lvl 3 to 2 at 640 min (W 2544 Th 944 Tr 3259 In 1429)
  Transition: Weary lvl 2 to 3 at 660 min (W 2596 Th 941 Tr 3279 In 1366)
  Transition: Weary lvl 3 to 2 at 670 min (W 2442 Th 940 Tr 3125 In 1366)
  Transition: Weary lvl 2 to 1 at 880 min (W 1754 Th 911 Tr 2357 In 1205)
  Weariness: 1662 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1721 Intake: 1093 Tracker: 2209 Thresh: 900 At: 1
  Cal: 52503/55000 Fatigue: 193 Morale: 0 Wgt: 74894 (BMI 24.5)

Log messages during failed test:
12:16:48PM: You eat your holy SPAM of debugging (fresh).
12:16:48PM: You start walking.
12:16:48PM: You eat your holy SPAM of debugging (fresh).
12:16:48PM: You start walking.
5.498 s: Heavy tasks
5.531 s: weary_recovery
12.180 s: 1 day vehicle work
12.180 s: weary_recovery
===============================================================================
test cases:  3 |  1 passed | 2 failed
assertions: 44 | 40 passed | 4 failed

22:56:54.216 INFO : Test world Test World 41253 left for inspection.
22:56:54.216 INFO : Ended test at Sat Feb  6 22:56:54 2021

22:56:54.216 INFO : The test took 44.5908 seconds
22:56:54.217 INFO : Randomness seeded to: 1612652312

This indicates that there is an interaction going on that influences whether the 1->0 fluctuation occurs, which may be in either weary_24h_tasks or weary_assorted_tasks (will try to check tonight but may be tomorrow or later). weary_24h_tasks, which ran first, also had errors (and 1->0 fluctuations):

Randomness seeded to: 1612652312

-------------------------------------------------------------------------------
weary_24h_tasks
  Digging 24 hours
-------------------------------------------------------------------------------
../tests/weary_test.cpp:172
...............................................................................

../tests/weary_test.cpp:183: FAILED:
  CHECK( info.transition_minutes( 5, 6, 730_minutes ) == Approx( 730 ).margin( 5 ) )
with expansion:
  745 (0x2e9) == Approx( 730.0 )
with messages:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1741 Intake: 927 Tracker: 0 Thresh: 847 At: 0
  Cal: 55392/55000 Fatigue: 288 Morale: 0 Wgt: 76824 (BMI 25.1)
  Transition: Weary lvl 0 to 1 at 110 min (W 1060 Th 1019 Tr 1380 In 639)
  Transition: Weary lvl 1 to 0 at 115 min (W 1006 Th 1020 Tr 1428 In 843)
  Transition: Weary lvl 0 to 1 at 120 min (W 1066 Th 1019 Tr 1488 In 843)
  Transition: Weary lvl 1 to 2 at 245 min (W 2011 Th 1000 Tr 2688 In 1353)
  Transition: Weary lvl 2 to 3 at 355 min (W 2724 Th 983 Tr 3478 In 1507)
  Transition: Weary lvl 3 to 4 at 465 min (W 3209 Th 968 Tr 3984 In 1549)
  Transition: Weary lvl 4 to 5 at 595 min (W 3561 Th 949 Tr 4270 In 1418)
  Transition: Weary lvl 5 to 6 at 745 min (W 3762 Th 929 Tr 4420 In 1316)
  Transition: Weary lvl 6 to 7 at 845 min (W 3920 Th 915 Tr 4520 In 1200)
  Transition: Weary lvl 7 to 8 at 935 min (W 4034 Th 903 Tr 4610 In 1151)
  Transition: Weary lvl 8 to 9 at 990 min (W 4118 Th 895 Tr 4665 In 1093)
  Transition: Weary lvl 9 to 10 at 1025 min (W 4181 Th 890 Tr 4700 In 1038)
  Transition: Weary lvl 10 to 11 at 1065 min (W 4221 Th 885 Tr 4740 In 1038)
  Transition: Weary lvl 11 to 12 at 1080 min (W 4262 Th 883 Tr 4755 In 986)
  Transition: Weary lvl 12 to 13 at 1100 min (W 4282 Th 880 Tr 4775 In 986)
  Transition: Weary lvl 13 to 14 at 1115 min (W 4297 Th 878 Tr 4790 In 986)
  Transition: Weary lvl 14 to 15 at 1130 min (W 4312 Th 876 Tr 4805 In 986)
  Transition: Weary lvl 15 to 16 at 1135 min (W 4342 Th 876 Tr 4810 In 936)
  Transition: Weary lvl 16 to 17 at 1140 min (W 4347 Th 875 Tr 4815 In 936)
  Transition: Weary lvl 17 to 18 at 1155 min (W 4362 Th 873 Tr 4830 In 936)
  Transition: Weary lvl 18 to 19 at 1160 min (W 4367 Th 872 Tr 4835 In 936)
  Transition: Weary lvl 19 to 20 at 1170 min (W 4377 Th 871 Tr 4845 In 936)
  Transition: Weary lvl 20 to 21 at 1175 min (W 4382 Th 870 Tr 4850 In 936)
  Transition: Weary lvl 21 to 22 at 1190 min (W 4397 Th 869 Tr 4865 In 936)
  Transition: Weary lvl 22 to 23 at 1195 min (W 4425 Th 868 Tr 4870 In 889)
  Transition: Weary lvl 23 to 24 at 1200 min (W 4430 Th 867 Tr 4875 In 889)
  Transition: Weary lvl 24 to 25 at 1210 min (W 4440 Th 866 Tr 4885 In 889)
  Transition: Weary lvl 25 to 26 at 1225 min (W 4455 Th 864 Tr 4900 In 889)
  Transition: Weary lvl 26 to 27 at 1235 min (W 4465 Th 862 Tr 4910 In 889)
  Transition: Weary lvl 27 to 28 at 1245 min (W 4475 Th 860 Tr 4920 In 889)
  Transition: Weary lvl 28 to 30 at 1255 min (W 4508 Th 859 Tr 4930 In 844)
  Transition: Weary lvl 30 to 31 at 1265 min (W 4518 Th 858 Tr 4940 In 844)
  Transition: Weary lvl 31 to 32 at 1275 min (W 4528 Th 856 Tr 4950 In 844)
  Transition: Weary lvl 32 to 33 at 1290 min (W 4543 Th 854 Tr 4965 In 844)
  Transition: Weary lvl 33 to 34 at 1300 min (W 4553 Th 853 Tr 4975 In 844)
  Transition: Weary lvl 34 to 36 at 1315 min (W 4589 Th 851 Tr 4990 In 801)
  Transition: Weary lvl 36 to 37 at 1320 min (W 4594 Th 850 Tr 4995 In 801)
  Transition: Weary lvl 37 to 38 at 1335 min (W 4609 Th 848 Tr 5010 In 801)
  Transition: Weary lvl 38 to 39 at 1350 min (W 4624 Th 846 Tr 5025 In 801)
  Transition: Weary lvl 39 to 42 at 1360 min (W 4634 Th 845 Tr 5035 In 801)
  Transition: Weary lvl 42 to 44 at 1375 min (W 4670 Th 843 Tr 5050 In 760)
  Transition: Weary lvl 44 to 45 at 1380 min (W 4675 Th 842 Tr 5055 In 760)
  Transition: Weary lvl 45 to 46 at 1395 min (W 4690 Th 840 Tr 5070 In 760)
  Transition: Weary lvl 46 to 47 at 1405 min (W 4700 Th 839 Tr 5080 In 760)
  Transition: Weary lvl 47 to 48 at 1420 min (W 4715 Th 837 Tr 5095 In 760)
  Transition: Weary lvl 48 to 49 at 1430 min (W 4725 Th 836 Tr 5105 In 760)
  Transition: Weary lvl 49 to 51 at 1435 min (W 4749 Th 835 Tr 5110 In 722)
  Weariness: 4754 Max Full Exert: NO_EXERCISE Mult: 0.1
  BMR: 1717 Intake: 722 Tracker: 5115 Thresh: 834 At: 51
  Cal: 51812/55000 Fatigue: 289 Morale: 0 Wgt: 74432 (BMI 24.3)

../tests/weary_test.cpp:184: FAILED:
  CHECK( info.transition_minutes( 6, 7, 835_minutes ) == Approx( 835 ).margin( 5 ) )
with expansion:
  845 (0x34d) == Approx( 835.0 )
with messages:

[identical to above]

../tests/weary_test.cpp:185: FAILED:
  CHECK( info.transition_minutes( 7, 8, 915_minutes ) == Approx( 915 ).margin( 10 ) )
with expansion:
  935 (0x3a7) == Approx( 915.0 )
with messages:

[identical to above]

Log messages during failed test:
12:04:48AM: You eat your holy SPAM of debugging (fresh).
12:04:48AM: You start walking.

@actual-nh
Copy link
Contributor Author

Same result as with Appveyor on Travis (Test/first build only):

(~[slow] ~[.])=>	Randomness seeded to: 1612673931
(~[slow] ~[.])=>	
(~[slow] ~[.])=>	-------------------------------------------------------------------------------
(~[slow] ~[.])=>	weary_recovery
(~[slow] ~[.])=>	  Heavy tasks
(~[slow] ~[.])=>	-------------------------------------------------------------------------------
(~[slow] ~[.])=>	../tests/weary_test.cpp:121
(~[slow] ~[.])=>	...............................................................................
(~[slow] ~[.])=>	
(~[slow] ~[.])=>	../tests/weary_test.cpp:134: FAILED:
(~[slow] ~[.])=>	  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
(~[slow] ~[.])=>	with expansion:
(~[slow] ~[.])=>	  660 (0x294) <= 480 (0x1e0)
(~[slow] ~[.])=>	with messages:
(~[slow] ~[.])=>	  
(~[slow] ~[.])=>	Digging Pits 8 hours, then waiting 8:
(~[slow] ~[.])=>	  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
(~[slow] ~[.])=>	  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
(~[slow] ~[.])=>	  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
(~[slow] ~[.])=>	  Transition: Weary lvl 0 to 1 at 125 min (W 1078 Th 1019 Tr 1500 In 843)
(~[slow] ~[.])=>	  Transition: Weary lvl 1 to 2 at 250 min (W 2023 Th 1000 Tr 2700 In 1353)
(~[slow] ~[.])=>	  Transition: Weary lvl 2 to 3 at 360 min (W 2735 Th 983 Tr 3489 In 1507)
(~[slow] ~[.])=>	  Transition: Weary lvl 3 to 4 at 470 min (W 3220 Th 967 Tr 3995 In 1549)
(~[slow] ~[.])=>	  Transition: Weary lvl 4 to 3 at 520 min (W 3105 Th 960 Tr 3866 In 1521)
(~[slow] ~[.])=>	  Transition: Weary lvl 3 to 2 at 640 min (W 2542 Th 944 Tr 3257 In 1429)
(~[slow] ~[.])=>	  Transition: Weary lvl 2 to 3 at 660 min (W 2594 Th 941 Tr 3277 In 1366)
(~[slow] ~[.])=>	  Transition: Weary lvl 3 to 2 at 670 min (W 2440 Th 940 Tr 3123 In 1366)
(~[slow] ~[.])=>	  Transition: Weary lvl 2 to 1 at 875 min (W 1753 Th 911 Tr 2356 In 1205)
(~[slow] ~[.])=>	  Weariness: 1661 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
(~[slow] ~[.])=>	  BMR: 1721 Intake: 1093 Tracker: 2208 Thresh: 900 At: 1
(~[slow] ~[.])=>	  Cal: 52504/55000 Fatigue: 193 Morale: 0 Wgt: 74894 (BMI 24.5)
(~[slow] ~[.])=>	
(~[slow] ~[.])=>	Log messages during failed test:
(~[slow] ~[.])=>	12:07:12AM: You eat your holy SPAM of debugging (fresh).
(~[slow] ~[.])=>	12:07:12AM: You start walking.
(~[slow] ~[.])=>	12:07:12AM: You eat your holy SPAM of debugging (fresh).
(~[slow] ~[.])=>	12:07:12AM: You start walking.

@actual-nh
Copy link
Contributor Author

actual-nh commented Feb 7, 2021

Local, weary_assorted_tasks then weary_recovery:

[No failures for weary_assorted_tasks]

Randomness seeded to: 1612652312
-------------------------------------------------------------------------------
weary_recovery
  Heavy tasks
-------------------------------------------------------------------------------
../tests/weary_test.cpp:120
...............................................................................
../tests/weary_test.cpp:133: FAILED:
  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
with expansion:
  660 (0x294) <= 480 (0x1e0)
with messages:
Digging Pits 8 hours, then waiting 8:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
  Transition: Weary lvl 0 to 1 at 125 min (W 1078 Th 1019 Tr 1500 In 843)
  Transition: Weary lvl 1 to 2 at 250 min (W 2023 Th 1000 Tr 2700 In 1353)
  Transition: Weary lvl 2 to 3 at 360 min (W 2735 Th 983 Tr 3489 In 1507)
  Transition: Weary lvl 3 to 4 at 470 min (W 3220 Th 967 Tr 3995 In 1549)
  Transition: Weary lvl 4 to 3 at 520 min (W 3105 Th 960 Tr 3866 In 1521)
  Transition: Weary lvl 3 to 2 at 640 min (W 2542 Th 944 Tr 3257 In 1429)
  Transition: Weary lvl 2 to 3 at 660 min (W 2594 Th 941 Tr 3277 In 1366)
  Transition: Weary lvl 3 to 2 at 670 min (W 2440 Th 940 Tr 3123 In 1366)
  Transition: Weary lvl 2 to 1 at 875 min (W 1753 Th 911 Tr 2356 In 1205)
  Weariness: 1661 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1721 Intake: 1093 Tracker: 2208 Thresh: 900 At: 1
  Cal: 52504/55000 Fatigue: 193 Morale: 0 Wgt: 74894 (BMI 24.5)

Log messages during failed test:
12:07:12PM: You eat your holy SPAM of debugging (fresh).
12:07:12PM: You start walking.
12:07:12PM: You eat your holy SPAM of debugging (fresh).
12:07:12PM: You start walking.
5.370 s: Heavy tasks
5.371 s: weary_recovery
11.845 s: 1 day vehicle work
11.845 s: weary_recovery

So as per the Appveyor results (2->3 fluctuation only, involving both intake and tracker).

Weary_24h_tests then weary_recovery:

Randomness seeded to: 1612652312
-------------------------------------------------------------------------------
weary_24h_tasks
  Digging 24 hours
-------------------------------------------------------------------------------
../tests/weary_test.cpp:172
...............................................................................
../tests/weary_test.cpp:183: FAILED:
  CHECK( info.transition_minutes( 5, 6, 730_minutes ) == Approx( 730 ).margin( 5 ) )
with expansion:
  745 (0x2e9) == Approx( 730.0 )
with messages:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1741 Intake: 927 Tracker: 0 Thresh: 847 At: 0
  Cal: 55392/55000 Fatigue: 288 Morale: 0 Wgt: 76824 (BMI 25.1)
  Transition: Weary lvl 0 to 1 at 110 min (W 1060 Th 1019 Tr 1380 In 639)
  Transition: Weary lvl 1 to 0 at 115 min (W 1006 Th 1020 Tr 1428 In 843)
  Transition: Weary lvl 0 to 1 at 120 min (W 1066 Th 1019 Tr 1488 In 843)
  Transition: Weary lvl 1 to 2 at 245 min (W 2011 Th 1000 Tr 2688 In 1353)
  Transition: Weary lvl 2 to 3 at 355 min (W 2724 Th 983 Tr 3478 In 1507)
  Transition: Weary lvl 3 to 4 at 465 min (W 3209 Th 968 Tr 3984 In 1549)
  Transition: Weary lvl 4 to 5 at 595 min (W 3561 Th 949 Tr 4270 In 1418)
  Transition: Weary lvl 5 to 6 at 745 min (W 3762 Th 929 Tr 4420 In 1316)
  Transition: Weary lvl 6 to 7 at 845 min (W 3920 Th 915 Tr 4520 In 1200)
  Transition: Weary lvl 7 to 8 at 935 min (W 4034 Th 903 Tr 4610 In 1151)
  Transition: Weary lvl 8 to 9 at 990 min (W 4118 Th 895 Tr 4665 In 1093)
  Transition: Weary lvl 9 to 10 at 1025 min (W 4181 Th 890 Tr 4700 In 1038)
  Transition: Weary lvl 10 to 11 at 1065 min (W 4221 Th 885 Tr 4740 In 1038)
  Transition: Weary lvl 11 to 12 at 1080 min (W 4262 Th 883 Tr 4755 In 986)
  Transition: Weary lvl 12 to 13 at 1100 min (W 4282 Th 880 Tr 4775 In 986)
  Transition: Weary lvl 13 to 14 at 1115 min (W 4297 Th 878 Tr 4790 In 986)
  Transition: Weary lvl 14 to 15 at 1130 min (W 4312 Th 876 Tr 4805 In 986)
  Transition: Weary lvl 15 to 16 at 1135 min (W 4342 Th 876 Tr 4810 In 936)
  Transition: Weary lvl 16 to 17 at 1140 min (W 4347 Th 875 Tr 4815 In 936)
  Transition: Weary lvl 17 to 18 at 1155 min (W 4362 Th 873 Tr 4830 In 936)
  Transition: Weary lvl 18 to 19 at 1160 min (W 4367 Th 872 Tr 4835 In 936)
  Transition: Weary lvl 19 to 20 at 1170 min (W 4377 Th 871 Tr 4845 In 936)
  Transition: Weary lvl 20 to 21 at 1175 min (W 4382 Th 870 Tr 4850 In 936)
  Transition: Weary lvl 21 to 22 at 1190 min (W 4397 Th 869 Tr 4865 In 936)
  Transition: Weary lvl 22 to 23 at 1195 min (W 4425 Th 868 Tr 4870 In 889)
  Transition: Weary lvl 23 to 24 at 1200 min (W 4430 Th 867 Tr 4875 In 889)
  Transition: Weary lvl 24 to 25 at 1210 min (W 4440 Th 866 Tr 4885 In 889)
  Transition: Weary lvl 25 to 26 at 1225 min (W 4455 Th 864 Tr 4900 In 889)
  Transition: Weary lvl 26 to 27 at 1235 min (W 4465 Th 862 Tr 4910 In 889)
  Transition: Weary lvl 27 to 28 at 1245 min (W 4475 Th 860 Tr 4920 In 889)
  Transition: Weary lvl 28 to 30 at 1255 min (W 4508 Th 859 Tr 4930 In 844)
  Transition: Weary lvl 30 to 31 at 1265 min (W 4518 Th 858 Tr 4940 In 844)
  Transition: Weary lvl 31 to 32 at 1275 min (W 4528 Th 856 Tr 4950 In 844)
  Transition: Weary lvl 32 to 33 at 1290 min (W 4543 Th 854 Tr 4965 In 844)
  Transition: Weary lvl 33 to 34 at 1300 min (W 4553 Th 853 Tr 4975 In 844)
  Transition: Weary lvl 34 to 36 at 1315 min (W 4589 Th 851 Tr 4990 In 801)
  Transition: Weary lvl 36 to 37 at 1320 min (W 4594 Th 850 Tr 4995 In 801)
  Transition: Weary lvl 37 to 38 at 1335 min (W 4609 Th 848 Tr 5010 In 801)
  Transition: Weary lvl 38 to 39 at 1350 min (W 4624 Th 846 Tr 5025 In 801)
  Transition: Weary lvl 39 to 42 at 1360 min (W 4634 Th 845 Tr 5035 In 801)
  Transition: Weary lvl 42 to 44 at 1375 min (W 4670 Th 843 Tr 5050 In 760)
  Transition: Weary lvl 44 to 45 at 1380 min (W 4675 Th 842 Tr 5055 In 760)
  Transition: Weary lvl 45 to 46 at 1395 min (W 4690 Th 840 Tr 5070 In 760)
  Transition: Weary lvl 46 to 47 at 1405 min (W 4700 Th 839 Tr 5080 In 760)
  Transition: Weary lvl 47 to 48 at 1420 min (W 4715 Th 837 Tr 5095 In 760)
  Transition: Weary lvl 48 to 49 at 1430 min (W 4725 Th 836 Tr 5105 In 760)
  Transition: Weary lvl 49 to 51 at 1435 min (W 4749 Th 835 Tr 5110 In 722)
  Weariness: 4754 Max Full Exert: NO_EXERCISE Mult: 0.1
  BMR: 1717 Intake: 722 Tracker: 5115 Thresh: 834 At: 51
  Cal: 51812/55000 Fatigue: 289 Morale: 0 Wgt: 74432 (BMI 24.3)

../tests/weary_test.cpp:184: FAILED:
  CHECK( info.transition_minutes( 6, 7, 835_minutes ) == Approx( 835 ).margin( 5 ) )
with expansion:
  845 (0x34d) == Approx( 835.0 )
with messages:
[Identical to the above]

../tests/weary_test.cpp:185: FAILED:
  CHECK( info.transition_minutes( 7, 8, 915_minutes ) == Approx( 915 ).margin( 10 ) )
with expansion:
  935 (0x3a7) == Approx( 915.0 )
with messages:
[identical to the above]

Log messages during failed test:
12:04:48AM: You eat your holy SPAM of debugging (fresh).
12:04:48AM: You start walking.
6.739 s: Digging 24 hours
6.739 s: weary_24h_tasks
-------------------------------------------------------------------------------
weary_recovery
  Heavy tasks
-------------------------------------------------------------------------------
../tests/weary_test.cpp:120
...............................................................................
../tests/weary_test.cpp:133: FAILED:
  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
with expansion:
  655 (0x28f) <= 480 (0x1e0)
with messages:
Digging Pits 8 hours, then waiting 8:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
  Transition: Weary lvl 0 to 1 at 120 min (W 1078 Th 1019 Tr 1500 In 843)
  Transition: Weary lvl 1 to 2 at 245 min (W 2023 Th 1000 Tr 2700 In 1353)
  Transition: Weary lvl 2 to 3 at 355 min (W 2735 Th 983 Tr 3489 In 1507)
  Transition: Weary lvl 3 to 4 at 465 min (W 3220 Th 967 Tr 3995 In 1549)
  Transition: Weary lvl 4 to 3 at 520 min (W 3115 Th 959 Tr 3876 In 1521)
  Transition: Weary lvl 3 to 4 at 545 min (W 3169 Th 956 Tr 3901 In 1463)
  Transition: Weary lvl 4 to 3 at 550 min (W 2979 Th 955 Tr 3711 In 1463)
  Transition: Weary lvl 3 to 2 at 640 min (W 2549 Th 943 Tr 3264 In 1429)
  Transition: Weary lvl 2 to 3 at 655 min (W 2596 Th 941 Tr 3279 In 1366)
  Transition: Weary lvl 3 to 2 at 670 min (W 2447 Th 939 Tr 3130 In 1366)
  Transition: Weary lvl 2 to 1 at 880 min (W 1757 Th 911 Tr 2360 In 1205)
  Weariness: 1659 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1721 Intake: 1093 Tracker: 2206 Thresh: 900 At: 1
  Cal: 52498/55000 Fatigue: 193 Morale: 0 Wgt: 74890 (BMI 24.5)

../tests/weary_test.cpp:134: FAILED:
  CHECK( info.transition_minutes( 3, 4, 16_hours ) <= ( 8 * 60 ) )
with expansion:
  545 (0x221) <= 480 (0x1e0)
with messages:
[identical to the above]

Log messages during failed test:
12:09:36AM: You eat your holy SPAM of debugging (fresh).
12:09:36AM: You start walking.
12:09:36AM: You eat your holy SPAM of debugging (fresh).
12:09:36AM: You start walking.
5.545 s: Heavy tasks
5.546 s: weary_recovery
-------------------------------------------------------------------------------
weary_recovery
  1 day vehicle work
-------------------------------------------------------------------------------
../tests/weary_test.cpp:138
...............................................................................
../tests/weary_test.cpp:148: FAILED:
  CHECK( info.transition_minutes( 1, 0, 995_minutes ) == Approx( 995 ).margin( 5 ) )
with expansion:
  980 (0x3d4) == Approx( 995.0 )
with messages:
3 meals, 10h vehicle work, 4h reading, 10h sleep, 16h waiting
  Weariness: 1659 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1721 Intake: 1093 Tracker: 2206 Thresh: 900 At: 1
  Cal: 52498/55000 Fatigue: 193 Morale: 0 Wgt: 74890 (BMI 24.5)
  Transition: Weary lvl 0 to 1 at 325 min (W 1029 Th 1019 Tr 1440 In 821)
  Transition: Weary lvl 1 to 2 at 625 min (W 1957 Th 970 Tr 2784 In 1653)
  Transition: Weary lvl 2 to 1 at 735 min (W 1906 Th 957 Tr 2732 In 1652)
  Transition: Weary lvl 1 to 0 at 980 min (W 929 Th 940 Tr 1856 In 1853)
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1729 Intake: 840 Tracker: 0 Thresh: 1061 At: 0
  Cal: 53582/55000 Fatigue: -1000 Morale: 3 Wgt: 75615 (BMI 24.7)

Log messages during failed test:
4:12:48 PM: You eat your holy SPAM of debugging (fresh).
4:12:48 PM: You start walking.
4:12:48 PM: You eat your smoked sausage (fresh).
4:12:48 PM: You eat your smoked sausage (fresh).
4:12:48 PM: You drink your milk (fresh).
4:12:48 PM: You drink your milk (fresh).
4:12:49 PM: You feel quite full, and a bit sluggish.
9:18:49 PM: You eat your smoked sausage (fresh).
9:18:49 PM: You eat your smoked sausage (fresh).
9:18:49 PM: You drink your milk (fresh).
9:18:49 PM: You drink your milk (fresh).
9:18:50 PM: You feel quite full, and a bit sluggish.
2:24:50 AM: You eat your smoked sausage (fresh).
2:24:50 AM: You eat your smoked sausage (fresh).
2:24:50 AM: You drink your milk (fresh).
2:24:50 AM: You drink your milk (fresh).
2:24:51 AM: You feel quite full, and a bit sluggish.
6:30:39 AM: You fall asleep.
12.242 s: 1 day vehicle work
12.243 s: weary_recovery

So:

  • 24h of digging gave a 1->0 fluctuation (from intake);
  • 8h digging + 8h waiting, preceded by 24h of digging, gave:
    • 3->4 fluctuation (with both intake and tracker involved)
    • 2->3 fluctuation (ditto)

Local weary_recovery followed by weary_24h_tests:

Randomness seeded to: 1612652312
-------------------------------------------------------------------------------
weary_recovery
  Heavy tasks
-------------------------------------------------------------------------------
../tests/weary_test.cpp:120
...............................................................................
../tests/weary_test.cpp:130: FAILED:
  CHECK( info.transition_minutes( 1, 0, 0_minutes ) > ( 8 * 60 ) )
with expansion:
  120 > 480 (0x1e0)
with messages:
Digging Pits 8 hours, then waiting 8:
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1738 Intake: 0 Tracker: 0 Thresh: 1038 At: 0
  Cal: 55000/55000 Fatigue: 0 Morale: 0 Wgt: 76562 (BMI 25.0)
  Transition: Weary lvl 0 to 1 at 115 min (W 1060 Th 1019 Tr 1380 In 639)
  Transition: Weary lvl 1 to 0 at 120 min (W 1006 Th 1020 Tr 1428 In 843)
  Transition: Weary lvl 0 to 1 at 125 min (W 1066 Th 1019 Tr 1488 In 843)
  Transition: Weary lvl 1 to 2 at 250 min (W 2011 Th 1000 Tr 2688 In 1353)
  Transition: Weary lvl 2 to 3 at 360 min (W 2724 Th 983 Tr 3478 In 1507)
  Transition: Weary lvl 3 to 4 at 470 min (W 3209 Th 968 Tr 3984 In 1549)
  Transition: Weary lvl 4 to 3 at 520 min (W 3095 Th 960 Tr 3856 In 1521)
  Transition: Weary lvl 3 to 2 at 640 min (W 2533 Th 944 Tr 3248 In 1429)
  Transition: Weary lvl 2 to 3 at 665 min (W 2590 Th 941 Tr 3273 In 1366)
  Transition: Weary lvl 3 to 2 at 670 min (W 2432 Th 940 Tr 3115 In 1366)
  Transition: Weary lvl 2 to 1 at 880 min (W 1748 Th 911 Tr 2351 In 1205)
  Weariness: 1651 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1722 Intake: 1093 Tracker: 2198 Thresh: 901 At: 1
  Cal: 52522/55000 Fatigue: 192 Morale: 0 Wgt: 74906 (BMI 24.5)

../tests/weary_test.cpp:133: FAILED:
  CHECK( info.transition_minutes( 2, 3, 16_hours ) <= ( 8 * 60 ) )
with expansion:
  665 (0x299) <= 480 (0x1e0)
with messages:
[Identical to the above]

Log messages during failed test:
12:00:00AM: You eat your holy SPAM of debugging (fresh).
12:00:00AM: You start walking.
12:00:00AM: You eat your holy SPAM of debugging (fresh).
12:00:00AM: You start walking.
5.881 s: Heavy tasks
5.881 s: weary_recovery
-------------------------------------------------------------------------------
weary_recovery
  1 day vehicle work
-------------------------------------------------------------------------------
../tests/weary_test.cpp:138
...............................................................................
../tests/weary_test.cpp:147: FAILED:
  CHECK( info.transition_minutes( 2, 1, 740_minutes ) == Approx( 740 ).margin( 5 ) )
with expansion:
  750 (0x2ee) == Approx( 740.0 )
with messages:
3 meals, 10h vehicle work, 4h reading, 10h sleep, 16h waiting
  Weariness: 1651 Max Full Exert: ACTIVE_EXERCISE Mult: 0.8
  BMR: 1722 Intake: 1093 Tracker: 2198 Thresh: 901 At: 1
  Cal: 52522/55000 Fatigue: 192 Morale: 0 Wgt: 74906 (BMI 24.5)
  Transition: Weary lvl 0 to 1 at 325 min (W 1029 Th 1019 Tr 1440 In 821)
  Transition: Weary lvl 1 to 2 at 620 min (W 1957 Th 970 Tr 2784 In 1653)
  Transition: Weary lvl 2 to 1 at 750 min (W 1904 Th 955 Tr 2766 In 1724)
  Transition: Weary lvl 1 to 2 at 755 min (W 1910 Th 954 Tr 2772 In 1724)
  Transition: Weary lvl 2 to 1 at 770 min (W 1789 Th 952 Tr 2651 In 1724)
  Transition: Weary lvl 1 to 0 at 995 min (W 893 Th 943 Tr 1787 In 1819)
  Weariness: 0 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1729 Intake: 850 Tracker: 0 Thresh: 1061 At: 0
  Cal: 53566/55000 Fatigue: -1000 Morale: 3 Wgt: 75604 (BMI 24.7)

Log messages during failed test:
4:03:12 PM: You eat your holy SPAM of debugging (fresh).
4:03:12 PM: You start walking.
4:03:12 PM: You eat your smoked sausage (fresh).
4:03:12 PM: You eat your smoked sausage (fresh).
4:03:12 PM: You drink your milk (fresh).
4:03:12 PM: You drink your milk (fresh).
4:03:13 PM: You feel quite full, and a bit sluggish.
9:09:13 PM: You eat your smoked sausage (fresh).
9:09:13 PM: You eat your smoked sausage (fresh).
9:09:13 PM: You drink your milk (fresh).
9:09:13 PM: You drink your milk (fresh).
9:09:14 PM: You feel quite full, and a bit sluggish.
2:15:14 AM: You eat your smoked sausage (fresh).
2:15:14 AM: You eat your smoked sausage (fresh).
2:15:14 AM: You drink your milk (fresh).
2:15:14 AM: You drink your milk (fresh).
2:15:15 AM: You feel quite full, and a bit sluggish.
6:21:03 AM: You fall asleep.
13.186 s: 1 day vehicle work
13.186 s: weary_recovery
9.626 s: Waiting 24 hours
9.626 s: weary_24h_tasks
-------------------------------------------------------------------------------
weary_24h_tasks
  Digging 24 hours
-------------------------------------------------------------------------------
../tests/weary_test.cpp:172
...............................................................................
../tests/weary_test.cpp:183: FAILED:
  CHECK( info.transition_minutes( 5, 6, 730_minutes ) == Approx( 730 ).margin( 5 ) )
with expansion:
  740 (0x2e4) == Approx( 730.0 )
with messages:
  Weariness: 3 Max Full Exert: EXTRA_EXERCISE Mult: 1
  BMR: 1741 Intake: 927 Tracker: 6 Thresh: 846 At: 0
  Cal: 55386/55000 Fatigue: 289 Morale: 0 Wgt: 76820 (BMI 25.1)
  Transition: Weary lvl 0 to 1 at 125 min (W 1078 Th 1019 Tr 1500 In 843)
  Transition: Weary lvl 1 to 2 at 250 min (W 2023 Th 1000 Tr 2700 In 1353)
  Transition: Weary lvl 2 to 3 at 360 min (W 2736 Th 983 Tr 3490 In 1507)
  Transition: Weary lvl 3 to 4 at 470 min (W 3207 Th 968 Tr 3996 In 1577)
  Transition: Weary lvl 4 to 5 at 600 min (W 3573 Th 949 Tr 4282 In 1418)
  Transition: Weary lvl 5 to 6 at 740 min (W 3764 Th 930 Tr 4422 In 1316)
  Transition: Weary lvl 6 to 7 at 845 min (W 3927 Th 916 Tr 4527 In 1200)
  Transition: Weary lvl 7 to 8 at 930 min (W 4036 Th 905 Tr 4612 In 1151)
  Transition: Weary lvl 8 to 9 at 985 min (W 4120 Th 896 Tr 4667 In 1093)
  Transition: Weary lvl 9 to 10 at 1020 min (W 4183 Th 892 Tr 4702 In 1038)
  Transition: Weary lvl 10 to 11 at 1060 min (W 4223 Th 886 Tr 4742 In 1038)
  Transition: Weary lvl 11 to 12 at 1080 min (W 4269 Th 884 Tr 4762 In 986)
  Transition: Weary lvl 12 to 13 at 1100 min (W 4289 Th 881 Tr 4782 In 986)
  Transition: Weary lvl 13 to 14 at 1115 min (W 4304 Th 879 Tr 4797 In 986)
  Transition: Weary lvl 14 to 15 at 1125 min (W 4314 Th 878 Tr 4807 In 986)
  Transition: Weary lvl 15 to 17 at 1140 min (W 4354 Th 876 Tr 4822 In 936)
  Transition: Weary lvl 17 to 18 at 1150 min (W 4364 Th 874 Tr 4832 In 936)
  Transition: Weary lvl 18 to 19 at 1160 min (W 4374 Th 873 Tr 4842 In 936)
  Transition: Weary lvl 19 to 21 at 1175 min (W 4389 Th 871 Tr 4857 In 936)
  Transition: Weary lvl 21 to 22 at 1190 min (W 4404 Th 869 Tr 4872 In 936)
  Transition: Weary lvl 22 to 24 at 1200 min (W 4437 Th 868 Tr 4882 In 889)
  Transition: Weary lvl 24 to 25 at 1210 min (W 4447 Th 867 Tr 4892 In 889)
  Transition: Weary lvl 25 to 26 at 1220 min (W 4457 Th 865 Tr 4902 In 889)
  Transition: Weary lvl 26 to 27 at 1230 min (W 4467 Th 863 Tr 4912 In 889)
  Transition: Weary lvl 27 to 28 at 1245 min (W 4482 Th 861 Tr 4927 In 889)
  Transition: Weary lvl 28 to 29 at 1255 min (W 4492 Th 860 Tr 4937 In 889)
  Transition: Weary lvl 29 to 30 at 1260 min (W 4520 Th 859 Tr 4942 In 844)
  Transition: Weary lvl 30 to 31 at 1265 min (W 4530 Th 858 Tr 4952 In 844)
  Transition: Weary lvl 31 to 32 at 1270 min (W 4535 Th 857 Tr 4957 In 844)
  Transition: Weary lvl 32 to 33 at 1285 min (W 4550 Th 855 Tr 4972 In 844)
  Transition: Weary lvl 33 to 34 at 1295 min (W 4560 Th 854 Tr 4982 In 844)
  Transition: Weary lvl 34 to 35 at 1305 min (W 4570 Th 852 Tr 4992 In 844)
  Transition: Weary lvl 35 to 37 at 1315 min (W 4601 Th 851 Tr 5002 In 801)
  Transition: Weary lvl 37 to 38 at 1325 min (W 4611 Th 850 Tr 5012 In 801)
  Transition: Weary lvl 38 to 39 at 1340 min (W 4626 Th 848 Tr 5027 In 801)
  Transition: Weary lvl 39 to 40 at 1350 min (W 4636 Th 846 Tr 5037 In 801)
  Transition: Weary lvl 40 to 42 at 1360 min (W 4646 Th 845 Tr 5047 In 801)
  Transition: Weary lvl 42 to 43 at 1365 min (W 4651 Th 844 Tr 5052 In 801)
  Transition: Weary lvl 43 to 45 at 1375 min (W 4682 Th 843 Tr 5062 In 760)
  Transition: Weary lvl 45 to 46 at 1385 min (W 4692 Th 842 Tr 5072 In 760)
  Transition: Weary lvl 46 to 47 at 1395 min (W 4702 Th 840 Tr 5082 In 760)
  Transition: Weary lvl 47 to 48 at 1410 min (W 4717 Th 838 Tr 5097 In 760)
  Transition: Weary lvl 48 to 49 at 1420 min (W 4727 Th 837 Tr 5107 In 760)
  Transition: Weary lvl 49 to 51 at 1435 min (W 4761 Th 835 Tr 5122 In 722)
  Transition: Weary lvl 51 to 52 at 1440 min (W 4766 Th 834 Tr 5127 In 722)
  Weariness: 4766 Max Full Exert: NO_EXERCISE Mult: 0.1
  BMR: 1717 Intake: 722 Tracker: 5127 Thresh: 834 At: 52
  Cal: 51799/55000 Fatigue: 289 Morale: 0 Wgt: 74423 (BMI 24.3)

../tests/weary_test.cpp:184: FAILED:
  CHECK( info.transition_minutes( 6, 7, 835_minutes ) == Approx( 835 ).margin( 5 ) )
with expansion:
  845 (0x34d) == Approx( 835.0 )
with messages:
  [Identical to the above]

../tests/weary_test.cpp:185: FAILED:
  CHECK( info.transition_minutes( 7, 8, 915_minutes ) == Approx( 915 ).margin( 10 ) )
with expansion:
  930 (0x3a2) == Approx( 915.0 )
with messages:
[Identical to the above]

Log messages during failed test:
7:10:47 AM: You eat your holy SPAM of debugging (fresh).
7:10:47 AM: You start walking.
6.595 s: Digging 24 hours
6.596 s: weary_24h_tasks

@actual-nh
Copy link
Contributor Author

actual-nh commented Feb 8, 2021

@anothersimulacrum (or anyone else doing tagging): C++, Code: Tests, Mechanics: Character/Player?
EDIT: Thanks!

@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Character / Player Character / Player mechanics labels Feb 8, 2021
In some conditions, namely continuous exercise at the same level, a
decrease in weariness level is unrealistic. Check for this.
Heavy tasks, while a logical section, do have the problem of repeating
the earlier task's information, making it harder to tell which task
triggered the message. Also make debug_weary_info() more informative
using additional clear_avatar().
Forgot to copy over identifier declaration.
Weary levels keep fluctuating unrealistically, probably because
weary.intake (and weary.tracker?) are changing in large jumps at times.
This adjusts expected test values to the (quite consistent) ones for
the altered weary intake/tracker. It also does the weary.tracker
adjustment in a less-perfectionistic (but more-functional) way.
@actual-nh
Copy link
Contributor Author

actual-nh commented Feb 12, 2021

I'm going to temporarily allow failures in two tests failing on 8/12-hour digging, to check on other-OS/compiler/etc w/regard to the other testing. (I'm not going to simply comment them out, so as to get more of a look at what's going on.) For at least the General Build Matrix, this should also speed things up a bit in the future via caching.

Two of the tests are doing a consistent failure due to fluctuations.
Ultimately, these fluctuations need eliminating, but it would be nice
to get some information on if anything else is going on.
This is an extension of a previous modification to try to smooth out
the weary.intake reduction (smaller changes but more frequent), and
both increases that and does similar for weary.tracker. The
weary.intake changes are leading up to - probably after 0.F - an
exponential moving average being used instead, so that characters
are not, essentially hypoglycemic.
@actual-nh
Copy link
Contributor Author

Doing some further smoothing, this time of both weary.intake and weary.tracker. The weary.intake parts will hopefully later be superseded by making it into an exponential moving average (unless someone wants a hypoglycemic character, perhaps?). Again allowing some failures in order to see rest of test results.

@actual-nh
Copy link
Contributor Author

actual-nh commented Feb 18, 2021

Huh. Seeing weary.tracker increases during rest periods again? (Quite probably already there but not visible due to tests not failing.) I think I may branch off something prior to any smoothing (right after f37d217) and put in output of weary.tick_counter and weary.low_activity_ticks to see if those give any clues.

EDIT: Done; see #47590.

This monitors, with weary level transitions, the low_activity_ticks
and tick_counter, to see if this can help figure out why weary.tracker
is increasing while resting.

(cherry picked from commit 4c4b9cd)
As far as I can tell, the cause of the weary.tracker going up during
resting periods is that rest does still expend calories (bmr),
and it happens every 5 minutes - while weary.tracker was only reduced
every 30 (current) or 15 (this branch) minutes. This commit makes
weary.tracker reduction occur every 5 minutes - every time
try_reduce_weariness() is called.
@actual-nh
Copy link
Contributor Author

actual-nh commented Feb 20, 2021

After I get some sleep and do other things, I will put the timing numbers from the weary tests together, likely with some local runs, and change the test minutes to fit the more gradual changes. The other change I plan to make next is to have the weary.tracker reduction only happening if there is at least 1 low-activity tick; currently, this makes no difference, but will if adjustments - following the original proposal, #42343 - are made for partial recovery during LOW_ACTIVITY and effects of fatigue/sleep modifications, low_activity_ticks will become a float/double. After the test timing and weary.tracker adjustment, I may put in a non-draft PR to incorporate these. The next stage will be an exponential moving average used for weary.intake, then probably adjustments to follow the original proposal more.

Some of the test times were being altered by the every-30-minute
(awake) weary.tracker reductions. Alter to match new ones, also taking
into account local testing (including in scrambled order). While with
some scrambled tests am seeing inconsistencies between 8-hour and
12-hour digging, 8-hour without fluctuations indicated 3->4 should not
be 470 minutes, but no more than 465 - which it already was for
12-hour, weirdly enough (oops by me earlier?).
@actual-nh
Copy link
Contributor Author

The local tests mentioned in the commit message:
local_tests_before_c68507b.log.txt

@Night-Pryanik
Copy link
Contributor

I suppose this PR is abandoned, since last commit was a year ago? I'm not sure if it should stay in PR tracker, especially with this many unresolved conflicts.

@Night-Pryanik
Copy link
Contributor

Closing as abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Character / Player Character / Player mechanics (P5 - Long-term) Long-term WIP, may stay on the list for a while.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants