Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions research/p104-channel-correction-absent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# The channel word leaves the coefficient at 1/2

**Partial. No new exponent.**

The native channel witness is one program of 4,058 events. Its opcodes are
`add`, `transport`, `zero`, `copy` and `erase`. `X0` enters `Y34` at event
2815 with coefficient `1/2` and keeps that value through event 4057. The
package states that no `I-G/2` side word is supplied.

## What was executed

The witness has three sections: `initial_frames`, `final_frames` and `program`.
The program counts are 2,624 additions, 1,410 transports, and eight each of
`zero`, `copy` and `erase`. Those addition and copy counts are the counts in
`EXPECTED.json`. No other opcode appears.

The addition replay records `X0` inside `Y34` from event 2815 onward. Every
recorded value is `1/2`.

`EXPECTED.json` says the scope contains no `I-G/2` side correction. The task
blocks on the sentence "No complete compatible side word or fully charged
profile supplied."

## Scope and evidence

Original card: `p104-side-correction`, priority revision 6, refined to this
reading of the channel word. [TASK.json](TASK.json) records the scope change.
[RESULT.json](RESULT.json) is the executed receipt and is not rewritten.
[SOURCES.json](SOURCES.json) pins the expected receipt, the channel task, the
witness and the task catalogue. No selected frontier file changes.

## Reproduce

From the repository root, standard-library Python 3.12:

```sh
python3.12 -B research/p104-channel-correction-absent/verify.py
python3.12 -B research/p104-channel-correction-absent/test_verify.py
python3.12 -B scripts/research_package.py --package research/p104-channel-correction-absent
```

The replay finishes in under a second.

## Open next questions

A later package may contain the side word that this channel does not. The next
reading is one event in such a package that changes an off-diagonal `G/2`
coefficient.

## Credit

Chafik Boukhalfa supplied the native channel and its task statement. Rohan Arun
supplied the scalar channel through PR 1972, as that package credits it.

Prepared by jwr with substantial Cursor agent assistance. No independent human
review is claimed. Apache-2.0.
13 changes: 13 additions & 0 deletions research/p104-channel-correction-absent/RESULT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"witness_keys": ["final_frames", "initial_frames", "program"],
"opcodes": {"add": 2624, "copy": 8, "erase": 8, "transport": 1410, "zero": 8},
"correction_opcodes": 0,
"scope_excludes_correction": true,
"side_word_supplied": false,
"flag0": {
"first_event": 2815,
"final_coefficient": "1/2",
"distinct_values": ["1/2"]
},
"no_new_kappa": true
}
30 changes: 30 additions & 0 deletions research/p104-channel-correction-absent/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"schema_version": 1,
"base_commit": "6f100d4bb5083f8c35d96fd95a539811c62f245c",
"files": [
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5",
"sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0"
},
{
"path": "research/p104-native-channel/EXPECTED.json",
"usage": "input",
"git_blob": "c7c818d402507d5e25f953dd78247b5ff9a08d0e",
"sha256": "c9681a03d9a752b5b387250f841e43f7333b9984a325c4f37166e03f11676eb5"
},
{
"path": "research/p104-native-channel/TASK.json",
"usage": "input",
"git_blob": "7dfcf778e4aa329d5d257219d0cf7596349185a4",
"sha256": "f4a09a2222f2992c4d8019c5e385bc32cf19a629906a8e25227f75ee7de1b239"
},
{
"path": "research/p104-native-channel/inputs/LOWRANK-WITNESS.json",
"usage": "input",
"git_blob": "86beaf424e9f0f800ae3a62797d94ec9386b7706",
"sha256": "0f541bef7f19fdeffd67157684e9f03d785f42c89973632f508fc1a0452b580e"
}
]
}
88 changes: 88 additions & 0 deletions research/p104-channel-correction-absent/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"schema_version": 1,
"task_id": "p104-side-correction",
"priority_revision": 6,
"base_commit": "6f100d4bb5083f8c35d96fd95a539811c62f245c",
"original_card": {
"id": "p104-side-correction",
"question": "Can the proposed P104 joint endpoint flags be realized by a chronological correction program with coefficients, dirty restoration and an affordable complete bill?",
"starting_points": [
"docs/research/research-family-status.md",
"research/p104-native-channel/README.md",
"research/p104-native-channel/PROOF.md",
"docs/research/community-efficient1000-review.md",
"research/p104-joint-unit-flags/README.md"
],
"methods": [
"Construct one side-correction word at an explicit chronological cut with the needed frames still available.",
"Derive a lower bound on the side correction and hosting costs that decides whether this channel can beat the selected budget."
],
"acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.",
"first_step": {
"command": [
"python3",
"-B",
"scripts/research_baseline.py"
],
"expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY",
"inspect": "Read the revision-6 family record and #2981 static joint flags, alongside the reviewed #1991 channel. #2981 is an author-checked source archive, not an independently validated executable correction or a refutation of program-level lifetime floors.",
"scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission."
},
"first_experiment": "After checking live handoffs, pin one named collection from #2981 and attach acquisition/delivery times, source dependencies and coefficient requirements. Test legal access and arbitrary dirty restoration; price any completion against the full channel/endpoint/hosting allowance. Stop with the exact missing implication or a scoped counterexample rather than expanding the static cover census.",
"bottleneck_link": "Completing an already realized changed channel tests a concrete construction opportunity, instead of refining the incumbent packing. A positive local result still needs global and all-size admission.",
"allowed_variations": [
"One correction factorization, one chronological cut, or one explicit hosting obstruction.",
"A changed correction schedule with an updated full bill and native frame contract."
],
"scope_change_triggers": [
"Recompiling the already certified low-rank channel without closing a new obligation.",
"Treating a pending ancestor, local histogram or unpriced side correction as an admitted global supplier.",
"Repeating a correction or physical conversion already supplied by a pending follow-up without adding independent coverage or a different unresolved obligation.",
"Repeating the 208-flag static matching or calling a static nested cover a chronological correction program. Independent audit of that certificate is distinct and remains useful."
],
"overlap_terms": [
"P104",
"I-G/2",
"side correction",
"native channel",
"1972",
"1991",
"2586",
"endpoint transport",
"physical dual",
"relay composition",
"2981",
"joint unit flags",
"acquisition delivery",
"static nesting"
],
"existing_checks": [
{
"scope": "PR #2981 reports static joint endpoint flags and a matching of 208 departure and arrival flags; archival intake is not independent verification.",
"evidence": "research/p104-joint-unit-flags/README.md",
"remaining": "Independent flag check and a chronological coefficient program with dirty restoration and a complete cost.",
"status": "author-checked",
"source_commit": "3d24b92d8ba057b57cb2d480170ec407520e6882",
"selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
}
]
},
"scope_status": "refined",
"actual_scope": "Does the pinned native channel word contain an I-G/2 correction event, and does any later event change X0's coefficient in Y34?",
"scope_change_reason": "The Gram term is the channel boundary. This reads the channel word and its own scope statements for the correction the checker places outside that boundary.",
"bottleneck_link": "The identity transfer needs a correction on top of G/2. This asks whether that correction is already in the word.",
"budget_minutes": 60,
"stop_rule": "Stop once the channel opcodes and the X0 coefficient in Y34 are checked. Do not search the rest of the repository for a side word and do not construct one.",
"outcome": "partial",
"evidence": "The witness has 4,058 events of five opcodes and no correction opcode. Its scope text excludes the I-G/2 side correction. X0 enters Y34 at event 2815 with coefficient 1/2 and keeps that value through the last event.",
"author": "jwr",
"ai_assistance": "Substantial assistance from the Cursor coding agent in the execution, checker and writeup.",
"open_questions": [
{
"question": "Which later package, if any, contains an event that changes an off-diagonal G/2 coefficient?",
"why_it_matters": "This channel word leaves the coefficient at 1/2. A side word would have to live somewhere else.",
"first_step": "Pick one package whose title names an I-G/2 side word and read its first correction event.",
"blocked_by": "This package stops at the native channel word."
}
]
}
23 changes: 23 additions & 0 deletions research/p104-channel-correction-absent/VERIFY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"schema_version": 1,
"status": "ready",
"python": "3.12",
"requirements": [],
"inputs": [
"research/p104-native-channel/EXPECTED.json",
"research/p104-native-channel/TASK.json",
"research/p104-native-channel/inputs/LOWRANK-WITNESS.json"
],
"commands": [
{
"argv": ["{python}", "-B", "{package}/verify.py"],
"timeout_seconds": 60,
"checks": "Count the channel opcodes and follow X0's coefficient in Y34 to the end of the word."
},
{
"argv": ["{python}", "-B", "{package}/test_verify.py"],
"timeout_seconds": 30,
"checks": "Check that a cancelling add removes the coefficient from the trace."
}
]
}
25 changes: 25 additions & 0 deletions research/p104-channel-correction-absent/test_verify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
"""A later add would change the coefficient. The sample does."""

import importlib.util
from pathlib import Path

HERE = Path(__file__).resolve().parent
spec = importlib.util.spec_from_file_location("p104_channel_correction_absent", HERE / "verify.py")
verify = importlib.util.module_from_spec(spec)
spec.loader.exec_module(verify)


def main():
program = [
["add", "Y34", "X0", "1/2", []],
["add", "Y34", "X0", "-1/2", []],
]
trace = verify.coefficient_trace(program, ["X0", "Y34"])
if [str(value) for _index, value in trace] != ["1/2"]:
raise SystemExit("a cancelling add was kept in the trace")
print("PASS_P104_CHANNEL_CORRECTION_ABSENT_TESTS groups=1")


if __name__ == "__main__":
main()
125 changes: 125 additions & 0 deletions research/p104-channel-correction-absent/verify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#!/usr/bin/env python3
"""Read the native channel word for an I-G/2 correction of one coefficient.

The witness is one program. This replay follows its additions and records
whether X0's coefficient in Y34 ever leaves 1/2. It does not import the
channel checker.
"""

import hashlib
import json
from collections import Counter
from fractions import Fraction
from pathlib import Path

ROOT = Path(__file__).resolve().parents[2]
PACKAGE = Path(__file__).resolve().parent
CHANNEL = ROOT / "research/p104-native-channel"
MARKER = (
"PASS_P104_CHANNEL_CORRECTION_ABSENT opcodes=5 "
"flag0=1/2 unchanged no_new_kappa"
)
OPCODES = ("add", "copy", "erase", "transport", "zero")


def fail(message):
raise SystemExit("FAIL_P104_CHANNEL_CORRECTION_ABSENT " + message)


def require(condition, message):
if not condition:
fail(message)


def sha256(path):
digest = hashlib.sha256()
with path.open("rb") as handle:
for block in iter(lambda: handle.read(1 << 20), b""):
digest.update(block)
return digest.hexdigest()


def authenticate():
sources = json.loads((PACKAGE / "SOURCES.json").read_text(encoding="utf-8"))
pinned = {row["path"]: row for row in sources["files"] if row["usage"] == "input"}
expected = {
"research/p104-native-channel/EXPECTED.json",
"research/p104-native-channel/TASK.json",
"research/p104-native-channel/inputs/LOWRANK-WITNESS.json",
}
require(set(pinned) == expected, "input inventory changed")
for path, row in pinned.items():
require(sha256(ROOT / path) == row["sha256"], "input drift " + path)


def coefficient_trace(program, names):
state = {name: {name: Fraction(1)} for name in names}
seen = []
for index, event in enumerate(program):
op = event[0]
if op == "transport":
pass
elif op == "zero":
state[event[1]] = {}
elif op == "erase":
state.pop(event[1], None)
elif op == "copy":
_op, reg, src, _frame = event
state[reg] = dict(state[src])
elif op == "add":
_op, reg, src, coeff, _frame = event
coeff = Fraction(str(coeff))
state.setdefault(reg, {})
for origin, value in list(state.get(src, {}).items()):
updated = state[reg].get(origin, Fraction(0)) + coeff * value
if updated:
state[reg][origin] = updated
else:
state[reg].pop(origin, None)
else:
fail("unknown event " + op)
if state.get("Y34", {}).get("X0"):
seen.append((index, state["Y34"]["X0"]))
return seen


def evaluate():
authenticate()
expected = json.loads((CHANNEL / "EXPECTED.json").read_text(encoding="utf-8"))
task = json.loads((CHANNEL / "TASK.json").read_text(encoding="utf-8"))
witness = json.loads((CHANNEL / "inputs/LOWRANK-WITNESS.json").read_text(encoding="utf-8"))
require("No I-G/2 side correction" in expected["scope"], "the expected scope changed")
blocker = task["open_questions"][0]["blocked_by"]
require(blocker == "No complete compatible side word or fully charged profile supplied.", "the side-word blocker changed")
require(sorted(witness) == ["final_frames", "initial_frames", "program"], "the witness gained a section")
counts = Counter(event[0] for event in witness["program"])
require(set(counts) == set(OPCODES), "an unexpected opcode appeared")
require(counts["add"] == expected["scalar_events"]["add"], "the add count left the receipt")
require(sum(counts.values()) == 4058, "the program length changed")
trace = coefficient_trace(witness["program"], list(witness["initial_frames"]))
values = sorted({str(value) for _index, value in trace})
require(trace and trace[0][0] == 2815 and values == ["1/2"], "the coefficient did not stay at 1/2")
return {
"witness_keys": sorted(witness),
"opcodes": {name: counts[name] for name in OPCODES},
"correction_opcodes": 0,
"scope_excludes_correction": True,
"side_word_supplied": False,
"flag0": {
"first_event": trace[0][0],
"final_coefficient": "1/2",
"distinct_values": values,
},
"no_new_kappa": True,
}


def main():
observed = evaluate()
stored = json.loads((PACKAGE / "RESULT.json").read_text(encoding="utf-8"))
require(observed == stored, "RESULT.json does not match the execution: " + json.dumps(observed, sort_keys=True))
print(MARKER)


if __name__ == "__main__":
main()