Skip to content

TRI-27 emulator: the modulus 19683 is 3^9, but tri_cpu.zig and executor.zig label it 3^27 #1169

Description

@dmitrii-f-t27

Where: tri_cpu.zig and executor.zig at 976df51.

What happens.

  • The machine reduces modulo 19683, which is 3^9.
  • The code labels it 3^27.
  • 3^27 = 7,625,597,484,987 appears nowhere in the tree.

Source: MODULUS_NOTE in specs/isa/tri27_machine.t27. The spec pins the value with the invariant the_modulus_is_three_to_the_nine (line 335).

Expected. Either the labels say 3^9, or the modulus becomes 3^27 if that was the intent. The two should not disagree.

Vector. No program vector, since the arithmetic is right and only the documentation is wrong. The spec's the_modular_scalar_operations test checks the value, e.g. mod_pos(-5, 19683) == 19678.

Found while writing the S05 specs of #988 (gHashTag/t27#3581); until now it lived only in the spec's FINDINGS. The vectors are replayed by tools/trinity_tri27.py in gHashTag/t27. Tracked in #1164.

Activity

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