Skip to content

hy-check+hy-emit — model curated time.time value-method surface (fixes #3933) - #3988

Open
Yumihariii wants to merge 1 commit into
limitlessprojects:mainfrom
Yumihariii:fix/time-time-surface-3933
Open

Yumihariii wants to merge 1 commit into
limitlessprojects:mainfrom
Yumihariii:fix/time-time-surface-3933

Conversation

@Yumihariii

Copy link
Copy Markdown
Contributor

fixes #3933

hy-check(foreign) gates method calls on curated handles against a pinned surface, but time.time had no arm — s.t.totally_fake() passed hyb check and only died later in go build. This fills the missing half of GUARANTEES row 13 for time.Time values: checker surface + emitter lowering, kept in lockstep.

Checker (hy-check/src/foreign.rs)

  • New TIME_TIME surface: the 28 single-return value methods the issue enumerates. Match arm covers value and pointer receivers, both the hy lowercase spelling and Go's capitalized one (time.time | time.Time).
  • method_result descriptors so chains stay inside the surface: add/add_date/round/truncate/utc/local/in → time.time, sub → time.duration (chains into the existing duration table), format/string → Str, predicates and scalar getters → Primitive.
  • Multi-return methods (Date, Clock, ISOWeek, Zone, ZoneBounds) stay rejected on both sides — Hybrid has no multi-value method lowering yet, so emitting them would reproduce the same go-build failure in a new place.

Emitter (hy-emit/src/shapes.rs)

  • The time.time SHAPES entry was an empty member table; it's now the exact Go spellings for those 28 methods (checker ⊆ emitter ⊆ Go, same contract as sync.mutex).
  • Every entry is a plain method, not method0: these are called with parens in hy (s.t.year()), and a method0 entry makes emit_call append a second paren pair (s.t.Year()() — invalid Go). The emitter regression tests pin that.

Tests

  • hy-check/tests/foreign_method_surface.rs: phantom rejection, real-method acceptance incl. utc().unix() chains, pointer/capitalized receivers, multi-return methods deliberately staying rejected.
  • hy-emit/tests/time_time_value_methods_3933.rs (new): exact Go spelling pins + a no-()() emission guard.

Verified against current main (e229ea7): with these tests on bare main the gate is red — checker 3/15 fail, emitter 2/2 fail (lowercase s.t.year() emitted verbatim). On this branch the full hy-check + hy-emit suites pass (431 test groups, 0 failures), and fmt drift is unchanged from main per file.

Related note for triage: #2764/#3012 also fill the emitter-side time.time table but predate this issue and only do half the contract (shapes without the checker arm); this PR pins both sides to the issue's list.

@Yumihariii
Yumihariii force-pushed the fix/time-time-surface-3933 branch from 57dec2d to 50c9b01 Compare November 7, 2026 10:26
@Yumihariii

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (67365d1) after #3924/#3927/#3929/#3932/#3935/#3944/#3902/#3904 landed — the const-block collisions in foreign.rs were pure unions, no semantic overlap with the new http/json/os/strings/net surfaces.

Re-verified on the merge tree with warm cache: cargo test -p hy-check -p hy-emit → 2829 passed / 0 failed, including this PR's time_time_value_methods_3933 (2 tests) and the hy-check surface cases. rustfmt drift on touched files is back to exactly main's baseline (19/5/4, 0 in the new emitter test).

One note for the DUP call: #2764 and #3012 fill the time.time hy-emit table too, but both are still unmerged open PRs from earlier cycles; this one is the check+emit pair in the shape the landed wave (#3924 etc.) established.

@Yumihariii
Yumihariii force-pushed the fix/time-time-surface-3933 branch from 50c9b01 to cd89e95 Compare November 7, 2026 14:18
@Yumihariii

Copy link
Copy Markdown
Contributor Author

Rebased onto fef44be — this also moves the base off the red tip (67365d1) onto a main that carries the mv fixture fix, so quick should finally run on its own merits here.

patch-id f83d786619dc98b98813b5b18bd61937ccbc9133 byte-identical to last round's head; pure single-commit replay, zero conflicts.

Gate (fresh target dir): cargo test -p hy-check -p hy-emit full set — 441 suites, 2839 tests, 0 failures.

Status vs the alternate PR on #3933: #3989 is still CONFLICTING with no push since 08:23Z. Ours covers both halves — the hy-check value-method surface and the hy-emit SHAPES table — with tests on each side, per the issue's acceptance criteria.

@Yumihariii
Yumihariii force-pushed the fix/time-time-surface-3933 branch from cd89e95 to c304934 Compare November 7, 2026 18:10
@Yumihariii

Copy link
Copy Markdown
Contributor Author

Rebased onto 0c1a9cd, patch-id identical to cd89e95, zero conflicts (foreign.rs and hy-emit shapes.rs untouched by the last sessions). Merged-tree gate green: foreign_method_surface 15/15, time_time_value_methods_3933 2/2, hy-check --lib 183, hy-emit --lib 193. The curated foreign-surface waves (#3922–#3944) landed other packages but never time.time, so HYB-E1002 still waves through fake time.time methods on current main — the fix remains needed.

@Yumihariii
Yumihariii force-pushed the fix/time-time-surface-3933 branch from c304934 to 0a4e7e4 Compare November 7, 2026 22:20
@Yumihariii

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (34 behind → 0, patch-id unchanged vs previous head c3049340ff).

Gate after rebase: cargo test -p hy-check --test foreign_method_surface 15/15, hy-check --lib 183/183, cargo test -p hy-emit --test time_time_value_methods_3933 2/2, hy-emit --lib 193/193. No new fmt drift introduced (branch fmt-dirty count identical to plain main baseline).

For context ahead of a DUP pass: the two fresh issues on the same table family (#4077 os.file_info/os.dir_entry, #4079 io.reader/writer/closer) are different receiver surfaces from this PR's time.time method table — no overlap in the entries or tests added here.

@github-actions github-actions Bot added bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) bot:stale-base Shepherd: behind main beyond threshold labels Nov 8, 2026
@Yumihariii
Yumihariii force-pushed the fix/time-time-surface-3933 branch from 0a4e7e4 to f3a3718 Compare November 8, 2026 12:15
@Yumihariii

Copy link
Copy Markdown
Contributor Author

Branch updated to main 736d2d8 (picks up #4084's channel-direction surfaces). Clean replay, patch-id unchanged (f83d7866). Full workspace test on the new base: 477 suites green; the single local failure was this box's PATH shadowing a go 1.27.1 over the pinned 1.26.9 — re-ran with the pinned toolchain and it passes, no code overlap with the landed sendability work.

@Yumihariii
Yumihariii force-pushed the fix/time-time-surface-3933 branch from f3a3718 to 066a802 Compare November 9, 2026 12:39
@Yumihariii

Yumihariii commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (810888a8) to clear the conflict introduced by #4198 landing — the collision was just the curated-surface const tables stacking at the same spot in foreign.rs. Resolution keeps both sides verbatim: the landed BUILTIN_ERROR/NET_ADDR/NET_ERROR tables and this PR's TIME_TIME, plus the merged match arms. Diff vs the new base is still additive-only across the same 4 files (+255/−3).

Re-ran the gates on the rebased tree:

No semantic change from the previous head, so the #3933 repro (phantom s.t.totally_fake() rejected, real 28-method surface accepted) still stands as verified in earlier comments.

One control note for the red compiler run: the failure is the 10-rust-crate-import examples e2e digest mismatch, which reproduces on main itself right now (810888a8, ci run 42607893435 — same compiler check-run conclusion=failure). Nothing in this branch's diff touches the examples harness; quick and preflight are green on the rebased head.

@Yumihariii

Copy link
Copy Markdown
Contributor Author

Heads-up on the compiler run on this head (066a802): quick ✅, preflight ✅, compiler ❌ — every failing path is under examples/*, none of which this PR touches. Facts:

@Yumihariii

Copy link
Copy Markdown
Contributor Author

Branch updated as the board asked: rebased onto 94b0e14, patch-id byte-identical to the head that CI previously ran green — zero content drift. Gates on the new base: foreign_method_surface 15/15, time_time_value_methods_3933 2/2, hy-check lib 183/183. Heads-up before verification: the compiler job's MVP-0 examples e2e currently fails on every PR based on main (root cause and evidence in my note above, tracked by #4236); quick and offline pass on this head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) bot:stale-base Shepherd: behind main beyond threshold

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[buildable] hy-check(foreign): foreign_method_surface omits curated time.time method surface (HYB-E1002, Row 13)

1 participant