Skip to content

fix: emit canonical two-binding TSEL and restore check closure - #41

Open
zhoubot wants to merge 3 commits into
linxfrom
codex/fix-tsel-contract-and-doc-gates
Open

fix: emit canonical two-binding TSEL and restore check closure#41
zhoubot wants to merge 3 commits into
linxfrom
codex/fix-tsel-contract-and-doc-gates

Conversation

@zhoubot

@zhoubot zhoubot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • emit canonical PTO TSEL as two ordered B.IOT bindings:
    1. predicate + true source, without last or destination;
    2. prior destination as explicit false source, with last and the new destination;
  • tie the prior destination to the output with an inline-asm matching constraint so source/destination aliasing observes the old value;
  • add a real Linx target compile/disassembly regression for TSEL;
  • make the target frontend gate validate the current checkout instead of silently preferring TileOP headers already installed in Clang's resource directory;
  • restore generated engine-index closure and document that B.IOR.RegSrc1 row stride is expressed in bytes.

The PTO ISA contract is unchanged. The model's rejection of the previous single-B.IOT bundle remains correct fail-closed behavior.

Root cause

The public in-place API TSEL(dst, mask, true_src) emitted one terminating B.IOT and implicitly treated the destination's prior value as the false source. Current PTO-SPEC requires that false source to be bound explicitly. SuperScalarModel therefore rejected the generated ELF before execution.

The existing target frontend script also loaded the packaged TileOP API before the checkout under test, so it could not prove source changes. The resource overlay in this PR preserves Clang builtin headers while replacing only tileop-api with the current repository.

Validation

make check
  35 Python contract tests: PASS
  host C++ syntax gates: PASS
  shell syntax gates: PASS

TC_DIR=<linx-toolchain-build run 33332380437, LLVM adcb879> \
MC_TRIPLE=linx64v5 \
  bash test/tileop_api/verify_pto0583_asm.sh
  PASS

TC_DIR=<same toolchain>/bin \
LINX_SYSROOT=<same toolchain>/sysroot/usr \
LINX_TARGET=linx64v5-unknown-linux-musl \
  bash test/tileop_api/verify_target_cxx_frontend.sh
  PASS

The TSEL probe disassembles to:

B.IOT t#2, t#1, mask=1111
B.IOT n#1, mask=1111, last, ->n<512B>

Tracking

Fixes #39.
Related to #31.
Cross-repository context:

@zhoubot

zhoubot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

Hosted gate result

Required check is green on run 33359574673:
https://github.com/LinxISA/Linx-TileOP-API/actions/runs/33359574673

Exact evidence from the run:

LLVM SHA: adcb879481d8feb73e17a4134f8ae955bd21ee32
Python contract tests: 35/35 PASS
Linx target object gate: 54/54 PASS
PTO ISA 0.58.4 MC/disassembly/negative contract: PASS
Linx target C++ frontend and TSEL disassembly contract: PASS

The first run exposed a pre-existing cache correctness bug: the cache key included only LLVM SHA but also restored installed TileOP headers. Commit 3f91e39 now mirrors the candidate headers into the cached compiler resource directory before target compilation, so the required gate validates the PR checkout rather than stale packaged headers.

@jiale-wangOwO

Copy link
Copy Markdown

@VV0003 跟进提醒:PR #41 的 API-side canonical TSEL lowering 已通过现有 Build/validation check,但仍未合入。

当前 ASL 已明确拒绝旧的单 B.IOT、destination 隐式 false-source 流;SuperScalarModel #338 不会为该 legacy ELF 放宽 validator,并会以“模型侧无待办”关闭。请推进本 PR 合入/安装,随后重编 tsel_inplace_probe 与受影响 Bench ELF,验证 canonical 两条 B.IOT 的 ELF 通过现有 gfrun 与独立结果检查;若 canonical ELF 仍失败,再回到模型仓开新的最小复现。

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.

[PTO v0.58][TSEL] API emits single-B.IOT but spec requires an explicit false-source binding

2 participants