Skip to content

feat(wcp): make ct max deterministic #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

letypequividelespoubelles
Copy link
Contributor

No description provided.

@letypequividelespoubelles letypequividelespoubelles linked an issue May 6, 2025 that may be closed by this pull request
Copy link
Collaborator

@DavePearce DavePearce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • (Latex) The latex wouldn't compile for me without modification. There is a missing colour called draculagreen. I put in simple definition so I could view the PDF.

  • (Determinism). I get the idea, but it doesn't seem right to impose BYTE_X != 0 when CT_i==1. I would think you need VLI==1 && CT==0 as the requirement. Otherwise, cannot I not construct ARG_1 / ARG_2 with something like 0xFF00FF which would be rejected by your requirement?

\item $\ct_{N} = \maxCt_{N}$.
\end{enumerate}
\saNote{} We don't explicitly impose anything on the value of $\maxCt_i$ when $\vli_i \equiv 1$.
But the above forces us to have at all times $0 \leq \ct_{i} \leq \maxCt_{i} < \llarge$, at the very least whenever $\wcpStamp_{i} \neq 0$ if the implementation omits the constraints marked with $(\trash)$.
\saNote{} When $\vli_i \equiv 1$, the value of $\maxCt_i$ is imposed:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a problem here in the presentation. Its not formatted as a bullet point list which I'm assuming is what you intended. Its actually very confusing and only by looking at the latex source could I understand what you meant.

@letypequividelespoubelles
Copy link
Contributor Author

* **(Determinism)**.  I get the idea, but it doesn't seem right to impose `BYTE_X != 0` when `CT_i==1`.  I would think you need `VLI==1 && CT==0` as the requirement.  Otherwise, cannot I not construct `ARG_1` / `ARG_2` with something like `0xFF00FF` which would be rejected by your requirement?

Having the check at CT == 0 is not possible, as it would make the request 0 GT 0 invalid. So we must check that the at least one of the four acc / byte is not zero, only if there are at least two rows. That's why the trigger is at CT == 1.
As we check the non nullity on the row before (ie where CT ==0), we have no issue with 0xFF00FF
That being said, I just changed to:

  • guard is CT != 0
  • one of. the acc_(i-1) is non zero

Just to have an inequalities as a guard instead of equality, to reduce a little bit the constraint.

@DavePearce
Copy link
Collaborator

DavePearce commented May 7, 2025

Having the check at CT == 0 is not possible

Wouldn't that be a One Line Instruction then? In which case you can separate that out. Anyway, it doesn't matter. Using ACC_x != 0 instead of BYTE_x != 0 definitely resolves any issue from my perspective.

Copy link
Collaborator

@DavePearce DavePearce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@letypequividelespoubelles
Copy link
Contributor Author

letypequividelespoubelles commented May 7, 2025

Having the check at CT == 0 is not possible

Wouldn't that be a One Line Instruction then? In which case you can separate that out. Anyway, it doesn't matter. Using ACC_x != 0 instead of BYTE_x != 0 definitely resolves any issue from my perspective.

you still can't check at CT == 0, even if VLI ==1, as it would make 0x00 GT 0x00 invalid. You need to exclude variable line instructions that takes only 1 line (because of small args) from this check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make WCP.CT_MAX deterministic
2 participants