Skip to content

Test: Round-trip numbers through state() now that the binder boxes them - #52

Merged
b-re-w merged 1 commit into
developfrom
work/box-scalars
Oct 3, 2026
Merged

b-re-w merged 1 commit into
developfrom
work/box-scalars

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 3, 2026

Copy link
Copy Markdown
Member

Closes #51

python-multiplatform #69 boxes scalars for Any slots, so state(0) and count.value += 1 work. The fake host now models PythonCallables' box and unbox entries in their real shape. The pinned refusal test flips to a round-trip test (bool, int, float, str), and an int beyond 64 bits stays refused with the reason. On binders older than #69 these tests skip. runtime code is unchanged: the boxing is the binder's.

Test changed or added: 2 tests. Documentation corrected: SPEC S5.4 and §8, PROJECT.md, guide, both READMEs.
Against 26485a02 (main checkout): 223 passed. No checkout: 125 passed, 98 skipped.

python-multiplatform #69 (PR #81, develop 26485a02) boxes a Python scalar
bound for a kotlin.Any slot by calling a PythonCallables box entry, and
unboxes a handle read back out of one through unboxScalar. So state(0) and
counter.value += 1 work; an int beyond 64 bits is refused with the reason.
The test that pinned the old refusal is flipped, as its comment promised.

The fake host gains the six entries in PythonCallables.kt's shape (boxInt,
boxLong, boxDouble, boxBoolean, boxString: one primitive slot, the box's handle
back as INT; unboxScalar: the handle in, the scalar or None out, releasing it),
and a scalar held in a kotlin.Any now crosses back as a handle, as a Kotlin
box would. Against a binder older than #69 the two scalar tests skip.

runtime/__init__.py is unchanged: the boxing is the binder's.

test changed: the refusal test becomes
test_scalars_round_trip_through_a_kotlin_any (bool, int, float, str, and
value += 1); test added: test_an_int_beyond_64_bits_is_refused_with_the_reason.
Red against 26485a02 before the fake host change: 2 failed (no exposed
declaration ...boxInt / ...boxString), then the old refusal test failed.
documentation corrected: SPEC S5.4 and section 8, PROJECT.md, guide, README
and README_ko; baselines.
Suite with python-multiplatform 26485a02 (main checkout, notebook and zip):
223 passed; without a checkout, 125 passed, 98 skipped. check_guide.py: 0.

Refs #51
Refs #11
@b-re-w
b-re-w merged commit 3061f67 into develop Oct 3, 2026
6 checks passed
@b-re-w
b-re-w deleted the work/box-scalars branch October 3, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant