Skip to content

Conversation

@achamayou
Copy link

@achamayou achamayou commented Oct 13, 2025

Before fix:

$ kramdown-rfc-extract-sourcecode draft-ietf-scitt-architecture-22.xml 
---
cddl:
- cddl-definition-for-signed-.cddl
- cddl-definition-for-a-trans.cddl
cbor-diag:
- cbor-extended-diagnostic-no.cbor-diag
- cbor-extended-diagnostic-not.cbor-diag
- cbor-extended-diagnostic-nota.cbor-diag
- cbor-extended-diagnostic-notat.cbor-diag
- cbor-extended-diagnostic-notati.cbor-diag
- cbor-extended-diagnostic-notatio.cbor-diag
svg:
- example-ssc-life-cycle-thre.svg
- relationship-of-concepts-in.svg
- signing-large-or-sensitive-.svg
ascii-art:
- example-ssc-life-cycle-thre.ascii-art
- relationship-of-concepts-in.ascii-art

After fix:

# ruby kramdown-rfc/bin/kramdown-rfc-extract-sourcecode draft-ietf-scitt-architecture-22.xml 
---
cddl:
- cddl-definition-for-signed-.cddl
- cddl-definition-for-a-trans.cddl
cbor-diag:
- cbor-extended-diagnostic-no.cbor-diag
- cbor-extended-diagnostic-notation-e-2.cbor-diag
- cbor-extended-diagnostic-notation-e-3.cbor-diag
- cbor-extended-diagnostic-notation-e-4.cbor-diag
- cbor-extended-diagnostic-notation-e-5.cbor-diag
- cbor-extended-diagnostic-notation-e-6.cbor-diag
svg:
- example-ssc-life-cycle-thre.svg
- relationship-of-concepts-in.svg
- signing-large-or-sensitive-.svg
ascii-art:
- example-ssc-life-cycle-thre.ascii-art
- relationship-of-concepts-in.ascii-art
- signing-large-or-sensitive-.ascii-art

@cabo
Copy link
Owner

cabo commented Oct 13, 2025

  • cbor-extended-diagnostic-notation-e-2.cbor-diag

What is the difference between before and after?

n = ni
nmax = [s.size, 40 - delta].min
while $seen_slugs[slugex = s[0...n]] && n < nmax
while $seen_slugs[slugex = s[0...ni]] && n < nmax
Copy link
Owner

Choose a reason for hiding this comment

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

This essentially counts n to nmax?
(ni doesn't change in the loop, so the termination is on the rhs of the &&)

Copy link
Author

Choose a reason for hiding this comment

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

My Ruby is extremely rusty and out of date, but if s.size > 32 - delta, it should only count to 32 - delta, and not all the way up to nmax I believe.
Having the boundary of the range expands as the loop iterates did not seem right.

Copy link
Owner

Choose a reason for hiding this comment

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

OK, I don't see the full intention here yet.
Obviously, meddling with the heuristics causes the need for changes in some makefiles, so I'd like to see a significant improvement

@achamayou
Copy link
Author

  • cbor-extended-diagnostic-notation-e-2.cbor-diag

What is the difference between before and after?

Sorry, copy paste error, this is hopefully clearer now.

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.

2 participants