Floor leisure at a small positive value so float32 utility stays finite - #18
Merged
hmgaudecker merged 3 commits intoSep 26, 2026
Conversation
…rence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
Leisure is s*logaddexp(F/s, available/s) with F = 1e-5 * time_endowment, so float32 felicity and its consumption derivative stay finite when work costs exceed the endowment, while cells away from the floor are unchanged to ~1e-8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
hmgaudecker
marked this pull request as ready for review
September 26, 2026 10:27
hmgaudecker
merged commit Sep 26, 2026
3bc89f7
into
codex/call-time-simulation-population
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Leisure is a smooth maximum of available leisure and a floor of
1e-5of the time endowment,s·logaddexp(F/s, available/s), instead of a softplus that bends to 0⁺.With leisure allowed to approach zero, some work choices (high hours, bad health, re-entry cost) drove leisure to ~1e-12, and utility and its consumption derivative overflowed float32 to ±inf. With the floor, both are finite in float32 across all preference types, health and labour-supply states, hours, ages 51–71 and the full consumption range, and match a 60-digit reference. Every work choice stays feasible and the map stays smooth; where available leisure exceeds 10% of the endowment, utility moves by less than 1e-7.
Tests:
tests/test_leisure_floor.py.https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW