Skip to content

Port tools/dedupe_identical_tests.py (Python, 2 functions) to specs/port/tools/dedupe_identical_tests.t27 #3984

Description

@gHashTag

Port tools/dedupe_identical_tests.py (Python, 2 functions) to specs/port/tools/dedupe_identical_tests.t27

Context

tools/dedupe_identical_tests.py is 150 lines of hand-written Python. Re-author its logic as specs/port/tools/dedupe_identical_tests.t27 so that t27c generates the equivalent. The Python file stays where it is - this issue adds the .t27 source it should have been written in.

.t27 is the hand-authored source language. t27c compiles it out to C, Rust, Verilog and Zig. You are writing source, not compiler output, and not prose about an implementation. The goal of this project is that every hand-written file in the repository is authored in .t27 and the other languages are generated from it - this issue is one file of that migration.

Read the original first

# from the repository root
$ wc -l tools/dedupe_identical_tests.py
$ sed -n '1,120p' tools/dedupe_identical_tests.py

What to write

Create specs/port/tools/dedupe_identical_tests.t27 with one .t27 function per Python function below. Keep the names exactly as they are - the name is how the port is checked. Quoted verbatim from the original:

  1. line 43 - def blocks(lines):
  2. line 73 - def process(path):

Add a test block for each of the 2 functions, asserting on the behaviour you read in the original. A ported body with nothing asserting on it is a claim, not a result - and the review compiles the generated Zig and runs exactly those tests.

Acceptance criteria

    1. test -f specs/port/tools/dedupe_identical_tests.t27 && echo present prints present (today the file does not exist)
    1. grep -cE '^\s*(pub )?fn (blocks|process)\(' specs/port/tools/dedupe_identical_tests.t27 prints 2 - every function above is ported under its own name
    1. t27c gen specs/port/tools/dedupe_identical_tests.t27 > /tmp/t27-gen.zig && grep -c 'not yet implemented' /tmp/t27-gen.zig prints 0, and t27c gen specs/port/tools/dedupe_identical_tests.t27 | wc -l prints more than 10 - an absent or empty file makes the grep print 0 on its own, so both halves are required
    1. t27c spec-status specs/port/tools/dedupe_identical_tests.t27 does not print NOPARSE - the file still parses. (This replaces a parse-metrics criterion. The compiler in the container prints no such metrics, so the command printed nothing and no work could ever satisfy it.)
    1. grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])' specs/port/tools/dedupe_identical_tests.t27 prints at least 2

Use t27c from the repository root, not the t27c on PATH: the PATH build prints no parse metrics at all, so criterion 4 greps nothing and an empty result reads as a pass.

Boundary

specs/port/tools/dedupe_identical_tests.t27

Activity

  1. gHashTag commented on Sep 20, 2026

    @gHashTag
    OwnerAuthor

    Re-filed as #4382.

    An attempt claimed this issue on 2026-09-17 and left an empty branch. A dispatch row that has spent its retry ceiling is released once and then keeps its issue for good, which is the right rule for a third identical failure and the wrong outcome for an issue nobody ever attempted twice. The new issue carries the same work, the same boundary, and today's brief.

    Closing this one so the swarm can take the work again.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions