Skip to content
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

feat(core): ldml marker normalization 🙀 #9761

Merged
merged 21 commits into from
Nov 21, 2023

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Oct 13, 2023

  • add some failing tests
  • fix them

For: #9468

@keymanapp-test-bot skip

@srl295 srl295 self-assigned this Oct 13, 2023
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Oct 13, 2023
@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S23 milestone Oct 13, 2023
@srl295 srl295 changed the title feat(core): ldml normalization 🙀 feat(core): ldml marker normalization 🙀 Oct 13, 2023
@github-actions github-actions bot added core/ Keyman Core feat labels Oct 13, 2023
@mcdurdin mcdurdin modified the milestones: A17S23, A17S24 Oct 15, 2023
@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Oct 19, 2023
Base automatically changed from feat/core/9468-test-improvement-epic-ldml to master October 20, 2023 03:58
@mcdurdin mcdurdin modified the milestones: A17S24, A17S25 Oct 27, 2023
@srl295 srl295 force-pushed the feat/core/9468-marker-normalization-epic-ldml branch from 247ce11 to 8796b50 Compare November 2, 2023 22:49
@srl295 srl295 changed the base branch from master to chore/developer/9838-cldr44-moredata-epic-ldml November 2, 2023 22:49
@github-actions github-actions bot added common/ common/resources/ Build infrastructure labels Nov 2, 2023
@srl295
Copy link
Member Author

srl295 commented Nov 2, 2023

moved the failing bengali test case here for fixin'!

Base automatically changed from chore/developer/9838-cldr44-moredata-epic-ldml to master November 3, 2023 17:29
@mcdurdin
Copy link
Member

mcdurdin commented Nov 3, 2023

I think we need to bring up to date with master in order for some of the Linux builds to work.

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

Oh my C++ Unicode escapes are so hard to read. Suggestions added

core/tests/unit/ldml/test_transforms.cpp Outdated Show resolved Hide resolved
core/tests/unit/ldml/test_transforms.cpp Outdated Show resolved Hide resolved
@srl295 srl295 marked this pull request as ready for review November 7, 2023 16:39
@mcdurdin
Copy link
Member

mcdurdin commented Nov 8, 2023

#9761 had 4 failures, Windows x 2 were:

02:37:59   ../../../src/debuglog.cpp(467): error C2220: the following warning is treated as an error
02:37:59   ../../../src/debuglog.cpp(467): warning C4477: 'snprintf' : format string '%4.6X' requires an argument of type 'unsigned int', but variadic argument 1 has type 'char32_t'

https://build.palaso.org/buildConfiguration/KeymanDesktop_TestPullRequests/422546?buildTab=log&focusLine=2451&linesState=370&logView=flowAware

and macOS:

73/83 keyman_core:ldml-keyboards / k_008_transform_norm        FAIL            0.06s   killed by signal 6 SIGABRT
...
83/83 keyman_core:ldml / test_transforms                       FAIL            0.81s   killed by signal 6 SIGABRT

https://build.palaso.org/buildConfiguration/Keyman_Common_KPAPI_TestPullRequests_macOS/422542?buildTab=log&focusLine=3094&linesState=89&logView=flowAware

Developer build failure was codesigning fail. Will restart that one but it will probably fail on Core?

@srl295
Copy link
Member Author

srl295 commented Nov 9, 2023 via email

@srl295
Copy link
Member Author

srl295 commented Nov 9, 2023

put in a patch

@srl295
Copy link
Member Author

srl295 commented Nov 11, 2023

@mcdurdin fail didn't seem to repro here, but it turns out:

image

but

../../../tests/unit/ldml/ldml_test_source.cpp:735: warning: (!rep_tests.empty()) && (rep_tests.size() > 0)
\x1b[38;5;196mTest failed with 0 at ../../../tests/unit/ldml/ldml.cpp:192:\x1b[0m
  ci->type != KM_CORE_CT_END && test_ci != test_context.end()

Seems like the status isn't being reported properly. So i'm getting false positives on my end.

EDIT Whoa, "test failed with 0" … but, that ends up std::exit(result * 100) i.e. exit(0) = success!

Hmm.

@srl295
Copy link
Member Author

srl295 commented Nov 11, 2023

@ermshiperete @mcdurdin std::exit(0) was being called on test failure… take a look at the test_assert.h change

@srl295 srl295 changed the base branch from master to fix/common/10004-truthful-test-epic-ldml November 14, 2023 13:29
@srl295
Copy link
Member Author

srl295 commented Nov 14, 2023

I cleaned this up and moved the test-case-fix stuff into another PR

- go back to NFD for the context, for now
- anticipating when the privatecontext is NFD but the public context is NFC
- also update the test cases

For: #9468
Base automatically changed from fix/common/10004-truthful-test-epic-ldml to master November 15, 2023 06:37
- a little further
- couple places where "it wasn't plugged in"
- adding some LDML-TODOs - marker creep
- fixed one unnecessary alloc/dealloc

For: #9468
- temporarily remove a backspace test until #9450 is fixed.

For: #9468
@srl295 srl295 marked this pull request as ready for review November 15, 2023 23:10
@srl295 srl295 marked this pull request as draft November 15, 2023 23:11
@srl295 srl295 marked this pull request as ready for review November 15, 2023 23:29
@mcdurdin
Copy link
Member

Keyman Core macOS build failed with:

Assertion failed: (*i == LDML_MARKER_CODE), function remove_markers, file ldml_transforms.cpp, line 1007.

@srl295
Copy link
Member Author

srl295 commented Nov 16, 2023

doesn't repro locally, checking still

@srl295 srl295 marked this pull request as draft November 16, 2023 17:53
- literally a bad assert. the error case is handled below, in fact the unit test tests for it.
- for some reason, assert.h wasn't included in some cases locally.

For: #9468
@srl295
Copy link
Member Author

srl295 commented Nov 16, 2023

doesn't repro locally, checking still

fixed, it was actually a bad assert. The case it was asserting for was handled in error checking code one line below. I had a local build environment that ended up ignoring the assert (which was a source bug also fixed)!

@srl295 srl295 marked this pull request as ready for review November 16, 2023 21:37
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

LGTM as far as it goes -- still more iterations needed on multiple markers between two chars I guess.

One issue possible with BT_UNKNOWN type backspaces -- it should only happen with an empty context.

assert(context.back().character == ch);
context.pop_back();
} else {
assert(act.backspace.expected_type == KM_CORE_BT_UNKNOWN); // else it must be unknown
Copy link
Member

Choose a reason for hiding this comment

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

BT_UNKNOWN should only be used when the context is empty.

Copy link
Member Author

Choose a reason for hiding this comment

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

added an assert for that request

@srl295
Copy link
Member Author

srl295 commented Nov 20, 2023

might as well update. mac failure seemed to be timeout

@srl295 srl295 merged commit 850491c into master Nov 21, 2023
25 checks passed
@srl295 srl295 deleted the feat/core/9468-marker-normalization-epic-ldml branch November 21, 2023 21:01
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.215-alpha

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

Successfully merging this pull request may close these issues.

3 participants