Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dozreg-toplud
Copy link
Contributor

@dozreg-toplud dozreg-toplud commented Aug 27, 2025

Resolves #861

To check:

  • parsers.c
  • urwasm.c

@dozreg-toplud dozreg-toplud marked this pull request as ready for review August 28, 2025 10:41
@dozreg-toplud dozreg-toplud requested a review from a team as a code owner August 28, 2025 10:41
u3z(a), a = t;
} while ( u3_nul != a );

u3z(a);
Copy link
Contributor Author

@dozreg-toplud dozreg-toplud Aug 28, 2025

Choose a reason for hiding this comment

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

A note for list logic jets: almost all changes include a transfer loop, where at the entry we gain a reference to a and then iterate over the list, gaining its tail and losing the list, then replacing the list with its tail. It means that at the end of the loop we still have a reference to a noun in a. We almost never lose it though, because a is 0, except for +levy/+lien, where we might break from the loop earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

technically the very first gain of the list is not necessary and we could unroll the loop, doing things as usual in the first iteration and starting to count the references after that, but IMO whatever gain we get from that is not worth the bloated code


if ( _(_cm_is_tas(som, len_w)) ) {
c3_w len_w = u3r_met(3, som);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bonus commit: pretty printer measured the length of the atom multiple times for some reason

pkg/noun/nock.c Outdated
u3_noun gul = u3nt(u3nc(1, 0), u3nc(0, 0), 0); // |~(^ ~) XX 409: just pass ~

return u3n_nock_et(gul, bus, fol);
return u3n_nock_et(u3_nul, bus, fol);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

u3m_soft_run now can take 0 instead of a scry gate to mean the same thing as _~, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It doesn't mean exactly the same thing: this will bail exit, while the prior behavior would block. But this function appears to be unused, so it's not clear that it matters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the function is used in urwasm where the behavior is imporant.

in ++mink definition in hoon.hoon scry gate ~ always blocks. In u3m_soft_esc there is no check, so that would indeed be bail exit. That's a bug, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, this is a jet mismatch:

> .*([-:mink [[0 [%12 1+0 1+0]] ~] +>:mink] -:mink)
[1 0]
> (mink [[0 [%12 1+0 1+0]] ~])
[%2 trace=~]

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch. The mismatch comes from urbit/urbit#7124 and the hoon is wrong -- +mink should crash if there is no scry handler.

@dozreg-toplud dozreg-toplud requested a review from joemfb August 28, 2025 13:36
Copy link
Collaborator

@joemfb joemfb left a comment

Choose a reason for hiding this comment

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

NB: I haven't closely reviewed the parser jet changes yet.

Copy link
Collaborator

@joemfb joemfb left a comment

Choose a reason for hiding this comment

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

tyfys

@pkova pkova merged commit d04f6e8 into next/kelvin/409 Sep 19, 2025
2 checks passed
@pkova pkova deleted the dozreg/prevent-c-stale-references branch September 19, 2025 15:50
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.

4 participants