Skip to content

Client caching fix (ImmutableGeophiresInputParameters); Fervo_Project_Cape-4 Multilaterals & Reservoir Volume #79

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

Merged
merged 40 commits into from
Jun 23, 2025

Conversation

softwareengineerprogrammer
Copy link
Owner

@softwareengineerprogrammer softwareengineerprogrammer commented Jun 19, 2025

Client caching fix: ImmutableGeophiresInputParameters

Description

Add ImmutableGeophiresInputParameters to enable caching behavior in GeophiresXClient.

GeophiresInputParameters existing hashing implementation is faulty and therefore currently prevents caching from working despite caching being enabled in the client by default. I investigated fixing this faulty implementation in GeophiresInputParameters (as opposed to adding the new ImmutableGeophiresInputParameters) but there are some theoretical edge cases where backwards compatibility could be broken, so the existing GeophiresInputParameters class/implementation is retained. However, we will likely replace GeophiresInputParameters implementation with ImmutableGeophiresInputParameters in v4.0 in order to soft-force migration, since any backwards-incompatible behavior existing consumers are relying on would be undesirable. (This can itself be seamlessly backwards-compatibly achieved by aliasing ImmutableGeophiresInputParameters = GeophiresInputParameters)

Note: caching is now disabled by default to prevent risk of unforeseen issues associated with cross-process resource sharing. It may be enabled by default in v4.0 once we have a bit more confidence that the risk of impact to existing users is negligible.

Testing & Verification

  1. Updates existing GeophiresInputParameters test https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/79/files#diff-f82c8dc96f982761d1d1273b513e4532b9045459cc56e6e0be0cff08dc82c9dbR15-R19
  2. Adds ImmutableGeophiresInputParametersTestCase: https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/79/files#diff-f82c8dc96f982761d1d1273b513e4532b9045459cc56e6e0be0cff08dc82c9dbR60
  3. Adds GeophiresClientCachingTestCase: https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/79/files#diff-7b54338a574c1cc3794aaf3267f1641b5e2bf154bd9c3f3be3385ba08719e507R10
  4. Adds multiprocessing safety test case to ensure client caching is thread safe: https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/79/files#diff-bd1ff26a0fc3bdd7d95c1c8462d719a015d3b620955732e9ee84c4dc92b275aaR35
  5. https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/79/files#diff-cf99a737840638038d7f18ad7e4c692566c74fbafd03c40847e9bcb957981412R11
  6. Further manually validated thread safety, caching correctness, and performance in my own consumer package that runs thousands of GEOPHIRES simulations in a multi-threaded program

Fervo_Project_Cape-4 Multilaterals & Reservoir Volume

  1. Set Number of Multilaterals to zero with comment: "This parameter is set to 0 because, for this case study, the cost of horizontal drilling (which would otherwise account for approximately 118 multilateral sections) is included within the 'vertical drilling cost.' This approach allows us to more directly convey the overall well drilling and completion cost, which is under $4 million." https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/80/files#diff-4c74f5cca6c379d27c945d138d703e4ef20d0abb1cd07282659e5b336e45ce2dR79
  2. Switch to Reservoir Volume Option 1 (FRAC_NUM_SEP), fixing previously slightly erroneous total number of fractures and reservoir volume (no functional effect on results) https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/81/files#diff-4c74f5cca6c379d27c945d138d703e4ef20d0abb1cd07282659e5b336e45ce2dR53-R54. (Note this also makes the input better-suited for Monte Carlo simulations)
  3. Update case study documentation accordingly
  4. Add unit test for case study documentation that checks that documented values match actual result values
  5. Add documentation/tooltip text for:
    1. Number of Multilateral Sections: https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/80/files#diff-3d85ef79807fc6c25a758a698fd3a7095750bd27ea52341700e1dad94885b5f6R950
    2. Drilling and completion costs per well: https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/80/files#diff-297987ad3d14c84ee6385298fa35b4691491b3cf35c15c45c23a1ea23b01c3ccR336

(Originally #81)

…eophiresXClient (GeophiresInputParameters faulty hashing implementation prevents caching from working)
@softwareengineerprogrammer softwareengineerprogrammer added bug Something isn't working enhancement New feature or request labels Jun 19, 2025
…ertical and horizontal costs are lumped for better result clarity. TODO to investigate using a deviated drilling correlation to possibly 'better' represent costs
…ling_and_completion_costs_per_well in Economics
…gs support to BaseTestCase._get_test_file_content
… apparently erroneously multiplied 108 * 102 instead of _118_ * 102). Corresponding and additional verifications in FervoProjectCape4TestCase
…behavior prior to the introduction of ImmutableGeophiresInputParameters, and we want to minimize the risk of caching-by-default causing unforeseen issues for existing consumers
…behavior prior to the introduction of ImmutableGeophiresInputParameters, and we want to minimize the risk of caching-by-default causing unforeseen issues for existing consumers
…cape-4-multilaterals_2

Fervo_Project_Cape-4 minor corrections: multilaterals, number of fractures
@softwareengineerprogrammer softwareengineerprogrammer changed the title Add ImmutableGeophiresInputParameters ImmutableGeophiresInputParameters caching fix; Fervo_Project_Cape-4 tweaks Jun 20, 2025
@softwareengineerprogrammer softwareengineerprogrammer changed the title ImmutableGeophiresInputParameters caching fix; Fervo_Project_Cape-4 tweaks ImmutableGeophiresInputParameters caching fix; Fervo_Project_Cape-4 Multilaterals & Reservoir Volume Jun 20, 2025
@softwareengineerprogrammer softwareengineerprogrammer changed the title ImmutableGeophiresInputParameters caching fix; Fervo_Project_Cape-4 Multilaterals & Reservoir Volume Client caching fix (ImmutableGeophiresInputParameters); Fervo_Project_Cape-4 Multilaterals & Reservoir Volume Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant