Answer the value at a timestamp from the MEOS entry that reports absence - #21
Merged
estebanzimanyi merged 1 commit intoSep 3, 2026
Conversation
WITNESS: a temporal value holds nothing outside its own span, and MEOS says so
by answering NULL. `CreateTemporal` reads `inner.temptype` with no nil test, so
that answer is dereferenced: removing the guard this commit adds takes
`ExampleCreateTemporal_absent` to
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4]
and 119 call sites reach `CreateTemporal` with a result that can be NULL.
The five `ValueAtTimestamp` accessors compose that path -- each one calls
`TemporalAtTimestamptz`, discards the conversion error with `_`, and reads the
instant -- where MEOS publishes the question directly:
`tbool_value_at_timestamptz(temp, t, strict, &value)` reports whether a value
is there and writes it out, with twins for tint, tfloat, ttext and tgeo. The
generated package already wraps all five, so the accessors delegate to them
across the pointer boundary rather than composing a restriction.
THE SHAPE COMES FROM THE SIBLING BINDINGS, WHICH SEPARATE ABSENCE FROM ERROR.
MEOS.NET's generated accessors return a nullable -- `public bool?
ValueAtTimestamptz(DateTime t, bool strict)`, and `int?` / `long?` / `double?`
for its siblings -- with `Assert.IsNull` covering the absent case in its own
test, while errors travel out of band through `SafeExecution`. PyMEOS-CFFI
agrees: `if result: return out_result[0] ... return None`, with `_check_error()`
raising separately. So absence is an optional result, not a failure. Go spells
an optional as a second result, and the generated wrapper here already returns
`(found, value, error)`, so the accessors return `(value, ok, error)`: `ok`
false leaves the value at its zero and the error nil, and the error is reserved
for a MEOS failure.
MEASURED: the suite reads 121 result lines, 0 skipped, against 118 before. The
three added examples pin the absent case for the boolean and float accessors
and for `CreateTemporal` itself, and each fails with the guard removed, so they
witness this change rather than accompany it.
estebanzimanyi
force-pushed
the
fix/value-at-timestamp-delegates
branch
from
September 3, 2026 10:05
49715b9 to
0c70563
Compare
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.
WITNESS: a temporal value holds nothing outside its own span, and MEOS says so
by answering NULL.
CreateTemporalreadsinner.temptypewith no nil test, sothat answer is dereferenced: removing the guard this commit adds takes
ExampleCreateTemporal_absenttoand 119 call sites reach
CreateTemporalwith a result that can be NULL.The five
ValueAtTimestampaccessors compose that path -- each one callsTemporalAtTimestamptz, discards the conversion error with_, and reads theinstant -- where MEOS publishes the question directly:
tbool_value_at_timestamptz(temp, t, strict, &value)reports whether a valueis there and writes it out, with twins for tint, tfloat, ttext and tgeo. The
generated package already wraps all five, so the accessors delegate to them
across the pointer boundary rather than composing a restriction.
THE SHAPE COMES FROM THE SIBLING BINDINGS, WHICH SEPARATE ABSENCE FROM ERROR.
MEOS.NET's generated accessors return a nullable --
public bool? ValueAtTimestamptz(DateTime t, bool strict), andint?/long?/double?for its siblings -- with
Assert.IsNullcovering the absent case in its owntest, while errors travel out of band through
SafeExecution. PyMEOS-CFFIagrees:
if result: return out_result[0] ... return None, with_check_error()raising separately. So absence is an optional result, not a failure. Go spells
an optional as a second result, and the generated wrapper here already returns
(found, value, error), so the accessors return(value, ok, error):okfalse leaves the value at its zero and the error nil, and the error is reserved
for a MEOS failure.
MEASURED: the suite reads 121 result lines, 0 skipped, against 118 before. The
three added examples pin the absent case for the boolean and float accessors
and for
CreateTemporalitself, and each fails with the guard removed, so theywitness this change rather than accompany it.