Repository navigation
Bugfix Virama, matching uucode (ghostty) - #222
Merged
Merged
Conversation
Discovered while analyzing Burmese, found in
``IndicSyllabicCategory.txt``, "causes conjunct formation", added in
Unicode 14.0:
# Indic_Syllabic_Category=Invisible_Stacker
#
# Invisible stacker (usually kills inherent vowel of consonant; is not visible
# by itself; causes conjunct formation or consonant
# stacking)
So this logically belongs with the others in _ISC_VIRAMA_SET. Use code
generation instead of the copy and paste done before, this set would
have changed in unicode releases 10, 11, 12, 13, 15, it will probably
change more again in the future.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #222 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 1548 1513 -35
Branches 370 364 -6
=========================================
- Hits 1548 1513 -35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Our previous implementation was perhaps too complex, but more "giving"
for width compared to uucode's implementation, and neither of ours
really has any basis in standards, seems to be of "taste". uucode's is
simpler -- it will probably improve performance, see code comment::
# Virama codepoints (Indic_Syllabic_Category=Virama|Invisible_Stacker)
# are treated as zero-width combining marks, matching Ghostty's uucode
# library. Whether a virama+consonant sequence should collapse to 1 or
# 2 cells is undefined by Unicode; we follow uucode's (1).
jquast
force-pushed
the
jq/bugfix-bermese-virama
branch
from
June 4, 2026 02:15
0f06113 to
dd857a4
Compare
Merging this PR will improve performance by 13.53%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_wcswidth_brahmic_devanagari |
2.5 ms | 2.2 ms | +14.03% |
| ⚡ | test_width_brahmic_devanagari |
2.7 ms | 2.4 ms | +13.03% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing jq/bugfix-bermese-virama (425ed1d) with master (e7673ff)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After careful review of Virama width calculation and study of uucode, two related changes:
Bugfix Invisible_Stacker viramas now form conjuncts (Burmese, Khmer, etc.)
Discovered while analyzing Burmese, found in
IndicSyllabicCategory.txt, "causes conjunctformation", added in Unicode 14.0:
So this logically belongs with the others in
_ISC_VIRAMA_SET. Use code generation instead ofthe copy and paste done before, this set would have changed in several past unicode releases and
so may change again in the future.
Change Virama+consonant width calculation to match @jacobsandlund's uucode (ghostty)
Our previous implementation was perhaps too complex, but more "giving" for width compared to
uucode's implementation, and neither of ours really has any basis in standards, seems to be of
taste. contour's libunicode does not make concern for virama, and uucode's does, measurement
is simpler to implement and will probably improve performance, see code comment::