PParityOchre
AI coding workspace

Hamming single-bit correction

ParityOchre is a Windows AI coding client for examining error-correction examples. Keep the channel assumption in the conversation while reviewing suggested parity logic and the limits of what it can identify.

● ● ●ParityOchre●
A concrete starting point · Hamming single-bit correction ×
def correct_hamming(word):
    word = list(word)
    if len(word) != 7 or any(type(b) is not int or b not in (0, 1) for b in word):
        raise ValueError("hamming.word")
    syndrome = 0
    for parity in (1, 2, 4):
        value = 0
        for position in range(1, 8):
            if position & parity:
                value ^= word[position-1]
        if value:
            syndrome |= parity
    if syndrome:
        word[syndrome-1] ^= 1
    data = (word[2] << 3) | (word[4] << 2) | (word[5] << 1) | word[6]
    return data, syndrome
✳Decode a seven-bit Hamming word under an explicit assumption of at most one flipped bit.
✓ ChangesReview before applying ↗
Illustrative workspace
01

Review before applying

Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

02

Connection

Base URL, credentials and a reachable server.

03

Project

Check intact words and every single-bit position, reject malformed or non-binary input and make no claim to detect multiple errors.

Workflows

Hamming single-bit correction

Workflows ↗
A concrete starting point
def correct_hamming(word):
    word = list(word)
    if len(word) != 7 or any(type(b) is not int or b not in (0, 1) for b in word):
        raise ValueError("hamming.word")
    syndrome = 0
    for parity in (1, 2, 4):
        value = 0
        for position in range(1, 8):
            if position & parity:
                value ^= word[position-1]
        if value:
            syndrome |= parity
    if syndrome:
        word[syndrome-1] ^= 1
    data = (word[2] << 3) | (word[4] << 2) | (word[5] << 1) | word[6]
    return data, syndrome
AI coding workspace

Keep experimental code honest about its operating assumptions

ParityOchre is a Windows AI coding workspace for moving a small technical experiment toward a clearly bounded software component. Open the source folder and describe the conditions under which the result will be used. Ask the model to inspect both the calculation and its caller, especially where an output might be interpreted as proof of successful recovery.

As one example, request a review of hamming.py under a single-bit error assumption. Supply an intact word and a word with one changed bit, then state how the application should present the returned data and syndrome. Discuss failures outside that assumption separately, rather than letting a plausible result imply that every damaged input was corrected.

Use the proposed edit to examine the interface around the experiment. Check input length and bit values, run independent fixtures in your environment and inspect the message the consumer displays. Clear output naming matters here: the application should communicate what the routine actually reports, without turning a bounded example into a broader reliability claim.

ParityOchre supports model connections through OpenAI-compatible or Anthropic endpoints, with credentials when required. An uncensored AI model is an option where offered, subject to provider restrictions. Available tools and context depend on the selected model and server; evidence from your fixtures remains necessary when reviewing the proposed software behavior.

Questions about bounded recovery experiments

Does a returned value prove the word was repaired?

Only within the assumptions established for the routine and the input. A plausible data value alone does not establish successful correction of arbitrary damage. Review how the application describes the result so users are not shown a stronger assurance than the experiment supports.

What should the input validation cover?

Use the expected word length and allowed bit values from the project contract. Include malformed length and non-bit entries in the fixtures. Inspect rejection through the caller as well, because a helper exception is not necessarily a useful application response.

Why include intact words in the tests?

They check the no-change path and the meaning of the reported syndrome when no correction is indicated. Compare the extracted data with an independent expected value. Testing only damaged examples can miss a defect in ordinary input handling or output interpretation.

How should I request broader error handling?

State the additional error cases and the evidence the application needs to distinguish them. Treat that as a new design requirement rather than a small patch to the existing example. Review the proposed interface and tests before assuming it supports a stronger recovery guarantee.

Get the Windows app ↗

ParityOchre · Updated 2026-10-25