nyash-codex
22b0c14adb
feat(joinir): Phase 135 P1 - Contract checks Fail-Fast (二度と破れない設計)
## Summary
Adds early Fail-Fast contract verification to prevent Phase 135 P0 issues from recurring.
Two new verifiers catch allocator SSOT violations and boundary inconsistencies before --verify.
## Changes
### Step 1: verify_condition_bindings_consistent
**Location**: `src/mir/builder/control_flow/joinir/merge/contract_checks.rs`
**Contract**: condition_bindings can have aliases (multiple names for same join_value),
but same join_value with different host_value is a violation.
**Example Error**:
```
[JoinIRVerifier/Phase135-P1] condition_bindings conflict:
join_value ValueId(104) mapped to both ValueId(12) and ValueId(18)
```
**Catches**: ConditionLoweringBox bypassing SSOT allocator before BoundaryInjector
### Step 2: verify_header_phi_dsts_not_redefined
**Location**: `src/mir/builder/control_flow/joinir/merge/contract_checks.rs`
**Contract**: Loop header PHI dst ValueIds must not be reused as dst in non-PHI instructions.
Violation breaks MIR SSA (PHI dst overwrite).
**Example Error**:
```
[JoinIRVerifier/Phase135-P1] Header PHI dst ValueId(14) redefined by non-PHI instruction in block 3:
Instruction: Call { dst: Some(ValueId(14)), ... }
```
**Catches**: ValueId collisions between header PHI dsts and lowered instructions
### Integration
**Location**: `src/mir/builder/control_flow/joinir/merge/mod.rs`
Added to `verify_joinir_contracts()`:
1. Step 1 runs before merge (validates boundary)
2. Step 2 runs after merge (validates func with PHI dst set)
### Documentation
- Updated `phase135_trim_mir_verify.sh` - Added P1 contract_checks description
- Updated `phase-135/README.md` - Added P1 section with contract details and effects
## Acceptance
✅ Build: SUCCESS
✅ Smoke: phase135_trim_mir_verify.sh - PASS
✅ Regression: phase132_exit_phi_parity.sh - 3/3 PASS
✅ Regression: phase133_json_skip_whitespace_llvm_exe.sh - PASS
## Effect
- **Prevention**: Future Box implementations catch SSOT violations immediately
- **Explicit Errors**: Phase 135-specific messages instead of generic --verify failures
- **Unbreakable**: Debug builds always detect violations, enforced by CI/CD
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 19:25:33 +09:00
..
2025-09-26 00:42:55 +09:00
2025-09-06 06:24:08 +09:00
2025-10-31 19:22:00 +09:00
2025-08-28 12:09:09 +09:00
2025-11-09 00:57:10 +09:00
2025-12-02 12:38:01 +09:00
2025-09-19 02:07:38 +09:00
2025-12-04 19:11:20 +09:00
2025-11-08 23:45:29 +09:00
2025-12-04 20:13:21 +09:00
2025-10-31 19:22:00 +09:00
2025-11-11 02:07:12 +09:00
2025-09-07 07:28:53 +09:00
2025-12-02 12:38:01 +09:00
2025-11-01 12:19:17 +09:00
2025-11-02 15:43:43 +09:00
2025-12-10 00:01:53 +09:00
2025-12-10 00:01:53 +09:00
2025-12-15 19:25:33 +09:00
2025-12-10 00:01:53 +09:00
2025-09-06 06:24:08 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-09-14 00:44:28 +09:00
2025-11-06 15:41:52 +09:00
2025-12-10 00:01:53 +09:00
2025-08-29 23:11:21 +09:00
2025-12-10 00:01:53 +09:00
2025-11-09 15:11:18 +09:00
2025-11-07 19:32:44 +09:00
2025-09-01 23:44:34 +09:00
2025-12-15 11:06:26 +09:00
2025-09-14 04:51:33 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-09-16 23:49:36 +09:00
2025-09-06 06:24:08 +09:00
2025-09-05 05:16:21 +09:00
2025-09-05 05:16:21 +09:00
2025-11-01 18:53:15 +09:00
2025-11-06 15:41:52 +09:00
2025-08-26 01:42:18 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-11-15 05:42:32 +09:00
2025-11-06 15:41:52 +09:00
2025-11-01 13:28:56 +09:00
2025-12-02 12:38:01 +09:00
2025-12-02 12:38:01 +09:00
2025-11-06 15:41:52 +09:00
2025-12-10 00:01:53 +09:00
2025-12-10 00:01:53 +09:00
2025-12-04 15:00:45 +09:00
2025-12-04 14:19:48 +09:00
2025-12-04 19:15:37 +09:00
2025-12-08 18:57:05 +09:00
2025-12-02 12:38:01 +09:00
2025-11-06 15:41:52 +09:00
2025-09-14 04:51:33 +09:00
2025-11-11 21:24:51 +09:00
2025-09-04 11:34:15 +09:00
2025-11-06 15:41:52 +09:00
2025-09-04 11:34:15 +09:00
2025-12-10 00:01:53 +09:00
2025-11-09 23:40:36 +09:00
2025-09-15 01:21:37 +09:00
2025-11-13 16:40:58 +09:00
2025-09-05 13:29:17 +09:00
2025-09-05 13:29:17 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-11-01 18:53:15 +09:00
2025-09-15 01:21:37 +09:00
2025-09-05 13:29:17 +09:00
2025-09-07 07:36:15 +09:00
2025-12-02 12:38:01 +09:00
2025-11-06 15:41:52 +09:00
2025-09-15 18:44:49 +09:00
2025-09-15 18:44:49 +09:00
2025-12-10 00:01:53 +09:00
2025-12-10 00:01:53 +09:00
2025-12-10 00:01:53 +09:00
2025-11-23 05:53:27 +09:00
2025-09-27 08:45:25 +09:00
2025-09-27 08:45:25 +09:00
2025-09-04 11:34:15 +09:00
2025-11-06 15:41:52 +09:00
2025-12-10 00:01:53 +09:00
2025-09-19 02:07:38 +09:00
2025-09-19 02:07:38 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-09-18 13:35:38 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-09-15 22:14:42 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-09-21 08:53:00 +09:00
2025-09-15 18:44:49 +09:00
2025-12-10 00:01:53 +09:00
2025-09-15 18:44:49 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-09-15 18:44:49 +09:00
2025-12-10 00:01:53 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-11-15 22:32:13 +09:00
2025-12-10 00:01:53 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-12-02 12:38:01 +09:00
2025-11-01 18:53:15 +09:00
2025-11-06 15:41:52 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-11-08 17:04:21 +09:00
2025-12-10 00:01:53 +09:00
2025-11-30 14:30:28 +09:00
2025-11-30 14:30:28 +09:00
2025-11-21 23:52:10 +09:00
2025-11-19 02:44:40 +09:00
2025-11-08 17:04:21 +09:00
2025-12-10 00:01:53 +09:00
2025-12-02 14:07:19 +09:00
2025-12-02 14:07:19 +09:00
2025-12-04 11:28:55 +09:00
2025-12-04 11:44:55 +09:00
2025-12-05 07:47:22 +09:00
2025-12-02 14:07:19 +09:00
2025-11-13 18:11:25 +09:00
2025-11-09 15:11:18 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-12-10 00:01:53 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-09-07 07:36:15 +09:00
2025-09-17 20:33:19 +09:00
2025-12-10 00:01:53 +09:00
2025-12-10 00:01:53 +09:00
2025-08-24 00:05:12 +09:00