If Intellicode Whole Line Completions are displayed, the suggestions widget does not open

Does this issue occur when all extensions are disabled?: Yes/No

VS Code Version: 1.60.0-insider (user setup)
OS Version: Windows_NT x64 10.0.19043
List of extensions that you have installed: Visual Studio IntelliCode Completions

Steps to Reproduce:

Open the attached .txt file, convert it to a typescript .ts file
main.txt

In line 5, type s= and you should see a gray text IntelliCode completion.

When you type what the completion shows, and get to typing a dot, ".".

When you type a ".", it is expected you see the suggestions widget. But the suggestions widget does not show up in the presence of gray text completion.

GIF -

@hediet

This is actually by design (the ghost text should not disappear when typing the text as suggested).
However, I want to change this so that autocomplete shows, but the item from the ghost text is preselected.

"the item from the ghost text is preselected", can you please clarify this? In the above scenario, since ".socket" is in the whole line completion, would "socket" be selected in the suggestions widget?

In the above scenario, since ".socket" is in the whole line completion, would "socket" be selected in the suggestions widget?

Yes, when the autocomplete opens automatically while the cursor is in ghost text, the preselected item should agree with the ghost text.
Otherwise the ghost text will just disappear when the autocomplete opens.

That sounds great! Do you have an estimate as to when this would be implemented?

Do you have an estimate as to when this would be implemented?

This milestone hopefully (i.e. early October).

There's no guarantee that result returned by the Copilot is in the list of the completions for given location

There's no guarantee that result returned by the Copilot is in the list of the completions for given location

You mean that a non-empty prefix of a copilot suggestion appears in the suggest widget?
Do you have an example where that could be problematic?

@Krzysztof-Cieslak @juihanamshet1 the feature will be available in tomorrows insiders build of VS Code.
I would love to hear your feedback!

I see there's a test plan item for this so marking as on-tesplan instead of verification-needed

@hediet this is the first I've heard of this, sorry I missed it. Can you please verify that the InlineCompletionItem itself will be listed in the popup? Since we don't currently register a regular completion item handler, only the inline version, will this mean a valid inline completion will just stop displaying in order to show the completion popup?
/cc @Krzysztof-Cieslak @isidorn

Since we don't currently register a regular completion item handler, only the inline version, will this mean a valid inline completion will just stop displaying in order to show the completion popup?

A "valid" inline completion item will only be not shown with this new behavior if no proper prefix of it is suggested by the autocomplete.
If no prefix of the inline completion is a valid auto-complete item, I think the inline completion is very likely to cause compile errors.

If no prefix of the inline completion is a valid auto-complete item, I think the inline completion is very likely to cause compile errors.

@hediet I guess that might depend on how good the auto-complete info is for a particular language. Is this behaviour going to be enabled for all languages?
Also is there any event when an inline completion item gets rejected by this logic?

Is this behaviour going to be enabled for all languages?

Yes.

Also is there any event when an inline completion item gets rejected by this logic?

No - they are not rejected, simply just not shown.

I guess that might depend on how good the auto-complete info is for a particular language.

Do you have an example where this is not good?
I've been using this feature for 20 days now and it seems to work nicely with TypeScript.

No - they are not rejected, simply just not shown.

I guess the terminology is a matter of perspective :-) From the point of view of our extension which is providing inline completion items, it'd be really useful to know if VSCode decided not to show them and why.

Do you have an example where this is not good?

I just had a quick play with Haskell and it offers auto-complete suggestions when I start writing a new function. I don't know what the general expectations around auto-complete are and this is arguably a bug in the language server or whatever is providing those suggestions, but it's the behaviour we have in practice today.

I just had a quick play with Haskell and it offers auto-complete suggestions when I start writing a new function.

Can you provide a screen recording/screenshot that shows why the auto-complete interfers with copilot in this case?
Does copilot suggest something that has no prefix which is suggested by auto-complete?
I would like to understand this problem better.

Here's a simple example:
https://user-images.githubusercontent.com/451141/135254469-bb0c3ac9-f23c-4c33-a695-91166a213aa8.mp4
I setup the prompt so that it's obvious to the model that myFunc2 needs to be implemented.
 Then I hit esc to cancel auto-complete and I see the Copilot suggestion, which is correct.

So let's look at this - here Copilot is making a suggestion based on the existing patterns in users code. asd, bsd and csd functions currently don't exist in accessible scope so they won't be present in the autocomplete list.
However, maybe the user just plan to implement them in the future? Or maybe they're just coming from different packages/files and all that's needed is an import statement? Copilot suggestions are not driven by semantic information, they potentially can produce not valid code... but it doesn't mean they are wrong.
https://user-images.githubusercontent.com/5427083/135254275-1437b4d6-6c8b-4f47-92c5-912694f1b463.mov

Can you set editor.inlineSuggest.allowQuickSuggestions to false and check if that is the desired behavior? Also pinging @juihanamshet1
That way, trigger characters still cause the autocomplete to show up while it does not show up when simply typing letters:

I think this would address all issues & feature requests.
We can set allowQuickSuggestions to false.

Did you mean editor.quickSuggestions (not editor.inlineSuggest.allowQuickSuggestions)? If so that works around this problem as auto complete doesn't appear, but it also disables it in scenarios where it does provide useful suggestions. Of course users will get it when there's a trigger character or can hit Ctrl-Space.
My feeling is that the root cause here is that both auto-complete and inline suggestion providers like Copilot are never right 100% of the time.
Where the two are not in conflict, it's a great user experience now because they still see auto-complete and the inline completion and can choose which direction to explore (accept the full inline completion, or reject it and pick a different auto-complete item).
It's where they disagree that there's a problem and it's hard for VS Code to know which one is right, particularly given the examples of currently invalid code that @Krzysztof-Cieslak mentioned above. Is there some way to present both to the user even when they do disagree? e.g. an empty item in auto-complete?

I tried editor.inlineSuggest.allowQuickSuggestions and it does help. I guess that when a trigger character like . is pressed, the behaviour still relies on the auto-complete suggestions actually being complete?

I guess that when a trigger character like . is pressed, the behaviour still relies on the auto-complete suggestions actually being complete?

Yes. However, we can iterate on that.
I'm also very interested in collecting (counter-) examples where the auto-complete suggestions are not complete (and missing the suggestion of copilot, or a prefix of it) when the user presses the trigger character.

Maybe we can explore only showing the suggest widget if there is an item that is a prefix of the inline suggestions.

@hediet here's what I've noticed so far...
Default Behaviour
Condition:

When editing in languages with a language server
AND without any grey-text extension installed

Behaviour:
The IntelliSense menu shows up as the user is typing (not just on trigger characters) **
What we're trying to build:
An option to allow opting out from the base VS Code IntelliSense behaviour while greytext is shown could be a solution that makes everyone happy.

For experiences where there's less grey text shown at once (i.e. IntelliCode), I think it makes sense to have IntelliSense shown while typing and on trigger characters. There's three benefits here:

In these scenarios, this interaction allows the user steer the suggestion as they type, along with 'jogging' their memory with helpful reminders/hints
We like to think of IntelliCode as an extension or an augmentation of the existing IntelliSense experience; given this, we prefer to keep the editing experience as similar to the base editing experience as possible

For the Copilot experience (and others) where up to a whole method can be predicted at once, the Intellisense list showing up can be particularly disruptive. For cases like this, I'm curious what the Copilot team's desired experience looks like.

When a grey text suggestion is shown, does the Intellisense list show on some trigger commands (i.e. Ctrl + Space) or none at all?
When a grey text suggestion is shown, does the Intellisense list show on some trigger characters (i.e. .) or none at all?

Early prototype:
@juihanamshet1 @Krzysztof-Cieslak @orph what do you think about this? The suggest widget would no longer hide, but the inline suggestion is preselected, so that the ghost text does not disappear.

Yes! We would love to have this behaviour; we've implemented something similar on the Visual Studio side.

Ok so here is what I think could be an awesome strategy to integrate autocomplete popup and inline completions more seamlessly, while also keeping the features separate as per requested Copilot user feedback:

when typing line the inline completion is shown and updates as you type
when an autocomplete trigger character is typed, the extension host request for completions items is made in the background
if the current inline completion starts with any of the returned completions item text, the AI is on track, so no popup is shown
otherwise the current inline completion does not match any completion items, the AI is off track, so hide the inline completion and show the autocomplete popup list

What do you think @hediet?

if the current inline completion starts with any of the returned completion item text, the AI is on track, so no popup is shown

Why do you want to hide the popup here? VS Code pre-selects the item in the popup and renders a preview for both the item and the remaining inline suggestion.
The only difference is:

Pressing "tab" first accepts the autocomplete, a second tab accepts the remaining inline suggestion
The popup is visible
The user can use the arrow keys to select a different item in the popup

As the user selects a different item, the inline suggestion provider can make use of that and provide an updated inline suggestion.
These are my thoughts:

Makes it annoying to accept the inline suggestion, as you have to press tab twice.

However, it makes it convenient to accept the autocomplete when the inline suggestion is only partially correct. This is a compromise and I think there is no clear winner.

Adds visual noise when focusing on inline suggestions, but also shows valuable information when focusing on auto-complete. Again a compromise.
This is independant of inline-suggestions, as arrow keys don't affect them. I would argue this is a feature without drawbacks.

Why do you want to hide the popup here? VS Code pre-selects the item in the popup and renders a preview for both the item and the remaining inline suggestion.

I think we're mostly worried that having both on the screen at the same time is visually distracting. It's based on the feedback we get from users in the early Copilot days (back when we were using Text Decorations API for ghost text).
That said back then the features were not in-sync - I'm not sure how much of the complaints were related to the fact there were 2 things on the screen and how much to the fact there were different suggestions displayed

I'm not sure how much of the complaints were related to the fact there were 2 things on the screen and how much to the fact there were different suggestions displayed

Didn't you also show the inline suggestion as autocomplete entry?
I totally understand the feedback that it is very confusing if inline suggestions and the autocomplete operate fully independent. But this feature is about making them work nicely together.

Additionally, I want to point out that what @orph has proposed wouldn't fix the issue described by @mtaran - in this case, we want to show a suggestion that is not on the list of completions. If pop up would be shown here (as described in point 4. in @orph's algorithm) we would "lose" it...
Maybe the solution is always showing autocomplete on trigger characters, and if our suggestion is not on the list some dummy entry should be added to the list of suggestions (and it would be selected by default)?

Maybe the solution is always showing autocomplete on trigger characters, and if our suggestion is not on the list, some dummy entry should be added to the list of suggestions (and it would be selected by default)?

I like that idea. I think that trigger characters are usually followed by identifiers (e.g. ID_START ID_CONT* as defined by unicode). That identifier could also be extracted from the inline suggestion.
Alternatively, we could not show the autocomplete if copilots suggestion (or a prefix of it) does not appear in it. But this only makes sense if copilot is correct more often than autocomplete.

I think there are two main questions here:

Do we ever want autocomplete and inline suggestions to show up simultaneously? The Copilot team has some experience from a while ago that it was bad, but that may be outdated.
If they can show up simultaneously, then it's reasonably clear what to do if they don't conflict (discussed extensively above). The question is what to do if they do conflict. Should one win? I would say not and I also think the dummy entry would be a good way to resolve it.

@hediet as @hsenag points out, I think there is some mixing questions here that I'd like to clarify Copilot's position on:

early user testing showed emphatically that mixing ghost text and autocomplete was visually overwhelming and ideologically confusing - people see them as different things
When we stopped trying to mix the two our complaints stopped
We have a handful of requests on the user forums that ask for showing autocomplete more often - not asking to integrate autocomplete with inline suggestions
at this time Copilot prefers to keep these features as separate as possible, with the guiding principle of “prefer inline suggestions but when the inline suggestion is wrong switch to autocomplete list”
we’re happy to revisit the early finding post November with a/b experiments and user interviews, but if the default setting is changed before we can finalize these finding we will have to override it
the algorithm I proposed above is an incremental improvement on the principle in (4), and addresses the “show autocomplete more often” user request in (3) — we hope it will be considered in the short term to improve Copilot as we ramp up users

@hediet @isidorn  should I file another issue to get this comment implemented? https://github.com/microsoft/vscode/issues/131940#issuecomment-931815784
We'd really like to have this as a UX improvement over the current situation to show the popup list more often when the inline suggestion isn't a good match.

That config setting helped me. In my case, I find TailwindCSS's Intellisense super useful and Copilot was suppressing it.

When copilot is enable in the project, NO other suggestion work except for the inline suggestion created by Copilot.

I don't think the setting is fully documented, but it still seems to be used: https://github.com/microsoft/vscode/blob/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/src/vs/editor/contrib/suggest/browser/suggestModel.ts#L112

Yeah thanks, I see the implementation.

Hey all, I wanted to share my thoughts as a user who's been struggling with this problem for a while now. I've mainly felt this pain when using VS Code with TypeScript IntelliSense and Copilot.
I've found that IntelliSense and Copilot inline suggestions serve very different purposes in my coding flow. IntelliSense tells me what's possible while Copilot tells me a best guess solution. I use IntelliSense when I'm not totally sure what I want to do but I want to see what my options are. I use Copilot when I know what I want but I don't want to type it out. IntelliSense is like searching documentation intersected with the knowledge of the type system. Copilot is like pairing with someone who knows you so well they can finish your sentences for you.
Given that, my ideal behavior would be:

Let Copilot keep making ghost text suggestions whenever it feels like it
After typing a dot, show me IntelliSense and hide the Copilot ghost text

This would allow me to keep relying on Copilot to help speed up my typing but have a seamless way to indicate to VS Code when I'm interested in IntelliSense (typing a dot). (There are also other IntelliSense trigger characters where it would be useful to hide Copilot - e.g. typing an opening quote mark in a place where the type system knows a union of strings is being used.)
A few thoughts on other suggestions from this thread:

Waiting til I type a character after the dot won't work well in cases where I need to browse all the available methods on an object (which happens quite often, e.g. when using libraries).
I don't think it would bother me too much to show both Copilot ghost text and IntelliSense suggestions at the same time, but reading above that it was confusing for others seems like good user feedback that should be honored.
I don't think Copilot suggestions should be shown in the IntelliSense suggestion pop-up, since they are distinctly different kinds of suggestions. I want to maintain my mental model of ghost text being moderately-reliable AI suggestions and the popup being extremely-reliable type system suggestions.

I'm sure I have some blind spots as I'm just one user with a specific use case, but hopefully this feedback can help as you keep working on this problem.

I don't see this mentioned anywhere here but an acceptable workaround is to manually trigger IntelliSense with a keyboard shortcut: Ctrl + space.

Just stumbling upon this thread after trying out Copilot with Golang in VSCode for a few weeks now. I think @jonahkagan did a good job of outlining what an intuitive behavior should be, at least for my workflow. The Copilot suggestions are great most of the time but when I hit certain trigger points (such as a dot) I nearly always want to see what my valid available options are and select from them, rather than have a suggestion that may not be valid.
Maybe it's just me though. Just one more data point.

I don't see this mentioned anywhere here but an acceptable workaround is to manually trigger IntelliSense with a keyboard shortcut: Ctrl + space.

This might work for some people, personally I've gotten used to IntelliSense suggestions coming up automatically at certain points without having to remember to hit another key.

IMO, the best user experience would be having copilot code as list items in the suggestions window. Combine that with the suggestion-preview setting and you'd be able to mix and match LSP and Copilot suggestions.
Take a look at this neovim plugin to see examples of this exact behavior. It works very well!

I've been using Copilot for the past few weeks, and, this is, by far, the most annoying thing about it. Could you at least make Copilot suggest valid things?
For example, this is Copilot suggestion for the Flutter launch_url plugin:

However, the LaunchMode has no such option:
enum LaunchMode {
  /// Leaves the decision of how to launch the URL to the platform
  /// implementation.
  platformDefault,

  /// Loads the URL in an in-app web view (e.g., Safari View Controller).
  inAppWebView,

  /// Passes the URL to the OS to be handled by another application.
  externalApplication,

  /// Passes the URL to the OS to be handled by another non-browser application.
  externalNonBrowserApplication,
}

This makes no sense, and it happens over and over again, making using Copilot very frustrating and slowing down development.

Just gonna drop this here for Copilot users:
[
  {
    "key": "alt+right",
    "command": "editor.action.inlineSuggest.showNext",
    "when": "textInputFocus && inlineSuggestionVisible"
  },
  {
    "key": "alt+left",
    "command": "editor.action.inlineSuggest.showPrevious",
    "when": "inlineSuggestionVisible && textInputFocus"
  },
  {
    "key": "alt+down",
    "command": "editor.action.triggerSuggest",
    "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly && !suggestWidgetVisible && inlineSuggestionVisible"
  }
]

These are the keybindings I use with vscode which really work great for me and solves this issue for me.
The important one is alt+down, this will show the suggestions (there is a default shortcut for that, but at least on a swiss keyboard it is HORRIBLE). And alt+down is just very intuitive for me -> open the dropddown.
The other two are to cycle through the copilot suggestions of you are not happy with the suggestion

This should be much improved in the latest VS Code Stable.
To be sure you get the behaviour make sure to set editor.inlineSuggest.suppressSuggestions: false in your settings.
Thanks all 👏
I will go ahead and close this issue, but I can reopen if we see there are still improvements to be made.

Seems to behave much better!

@lcrownover can you provide some details. What makes it better for you? Thanks!

@isidorn I successfully get the suggestions dropdown (LSP, etc) while the copilot ghost text is shown in the background.
Behavior seems to match the preview in https://github.com/microsoft/vscode/issues/131940#issuecomment-914370898.
I can hit enter or tab to accept the suggestion, then tab again to accept the copilot ghost text. (only needing one tab if no suggestion is shown).

This should be much improved in the latest VS Code Stable.  To be sure you get the behaviour make sure to set editor.inlineSuggest.suppressSuggestions: false in your settings.
Thanks all 👏 I will go ahead and close this issue, but I can reopen if we see there are still improvements to be made.

@isidorn There are still times when I expect IntelliCode to suggest methods when I hit a dot, but only CoPilot's suggestions appear.
I have attempted this on both VSCode 1.78.2 (system setup) and 1.79.0-insider (system setup), along with GitHub Copilot Nightly v1.86.118. All plugins are up-to-date.

This should be much improved in the latest VS Code Stable.  To be sure you get the behaviour make sure to set editor.inlineSuggest.suppressSuggestions: false in your settings.
Thanks all 👏 I will go ahead and close this issue, but I can reopen if we see there are still improvements to be made.

@isidorn Trying the new behaviour and it seems to be still broken, if copilot suggestion kicks in before I hit the ., LSP suggestions are not shown

Any idea what could be wrong?
env:

vscode 1.78.2 (stable) - all extensions disabled except for GH
GH copilot nightly v1.87.131
macOS 13.4
all extensions disabled except for copilot
all vscode settings commented out except for editor.inlineSuggest.suppressSuggestions: false

This should work for all extensions who don't set the suppressSuggestions flag in the returned inline completions result. Copilot sets it to true.

@hediet So is there a way to get it working? Or do I have to choose between copilot and language server suggestions showing automatically (without using the suggestions shortcut)?
Thanks a lot

What I'd really like to see are Copilot suggestions appearing in the intellisense dropdown, with configuration options on how many to show, the position in the list to use, etc (e.g., always insert the top copilot suggestion at the top, then N intellisense results, then Y copilot results, then the rest of intellisense). I think it would be worth re-opening this or creating a new issue to that end.
The real issue with the copilot UI is that it is fighting the already-mature intellisense dropdown rather than having suggestions appear there.

Just to let you know that we have pushed a fix so that now suggest widget is NOT suppressed by default.
So this should work better with VS Code Insiders from tomorrow. And this will be included in next stable (start of September). Try it out and let us know what you think. Thank you!


Failed to find compatible OS

I tried using Aftman to install a pixelfix, but I just couldn't install this one because it says "win" because of "windows"...
https://github.com/Corecii/Transparent-Pixel-Fix/releases/tag/1.0.0

I don't think there is any indication by that repo owner that they intend it to be downloadable by Aftman. Additionally, the last commit on that repo is further ago than Aftman was created.

I think we might be able to use win as one of the strings that indicates that the asset might be for Windows.


From section (p. 73): Adding the Stratospheric Construct Library

Not sure if the book needs to be update to new dependency version from:
<dependency>
<groupId>dev.stratospheric</groupId>
<artifactId>cdk-constructs</artifactId>
<version>0.0.27</version>
</dependency>

to
<dependency>
<groupId>dev.stratospheric</groupId>
<artifactId>cdk-constructs</artifactId>
<version>0.1.0</version>
</dependency>

After the change above it compiles, but still, there is some incongruence after running the dependency tree:
Dependency convergence error for software.amazon.awscdk:aws-cdk-lib:2.5.0 paths to dependency are:
+-com.myorg:first_cdk_app:0.1
  +-dev.stratospheric:cdk-constructs:0.1.0
    +-software.amazon.awscdk:aws-cdk-lib:2.5.0
and
+-com.myorg:first_cdk_app:0.1
  +-software.amazon.awscdk:aws-cdk-lib:2.0.0

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability the error(s) are [
Dependency convergence error for software.amazon.awscdk:aws-cdk-lib:2.5.0 paths to dependency are:
+-com.myorg:first_cdk_app:0.1
  +-dev.stratospheric:cdk-constructs:0.1.0
    +-software.amazon.awscdk:aws-cdk-lib:2.5.0
and
+-com.myorg:first_cdk_app:0.1
  +-software.amazon.awscdk:aws-cdk-lib:2.0.0
]

You can reproduce the above issue by adding:
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <configuration>
                    <rules><dependencyConvergence/></rules>
                </configuration>
 </plugin>

And running:
mvn enforcer:enforce

It seems you are ahead of AWS

Thanks for bringing this up. With the latest releases of the CDK constructs library (0.1.0) and the ebook (1.4) we've updated and synchronised all references to CDK libraries to the latest available version (2.8.0 for software.amazon.awscdk.aws-cdk-lib and 10.0.38 for software.constructs.constructs at release time).
I've just run mvn enforcer:enforce as per your suggestion and everything looks fine right now. Could you please check again if the error persists with the most recent Stratospheric CDK Constructs version and the source code from the latest ebook release?

Hi, all looks fine now. Thanks


Split Definitions.hs

It's horribly long file, which compiles extremely long on GHC 7.10. Is it ok to split it. I'm sure that not all of the types form a single cycle.

I don't see any issue with that, do you?

This is very annoying if I want to add new functionality (and iterate during development).
Alternatively I can add new types to new module,  so I don't need to recompile Definitions all the time. At that point, I'd prefer not to merge the new module into Definitions anymore.

I say split away then!


DOC: Remove outdated comment about sparse sampling

The comment said that sparse sampling was not allowed in itkANTSNeighborhoodCorrelationImageToImageMetricv4:

Sparse sampling is not supported by this metric. An exception will be
thrown if m_UseSampledPointSet is set. Support for sparse sampling
will require a parallel implementation of the neighborhood scanning, which
currently caches information as the neighborhood window moves.

This was true when the class was written, but a sparse sampling implementation was later added.
PR Checklist

[X] No API changes were made (or the changes have been approved)
[X] No major design changes were made (or the changes have been approved)
[X] Added test (or behavior not changed)
[X] Updated API documentation (or API not changed)
[X] Added license to new files (if any)
[X] Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
[X] Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for
further development details if necessary.

@cookpa Thanks for doing this. Can the commit pointed in the PR message be added to the commit message body, please (amend the commit to edit the message and push force)?

Sure @jhlegarreta , is there a preference for the full hash vs the abbreviated version?

Sure @jhlegarreta , is there a preference for the full hash vs the abbreviated version?

I don't think we've agreed on a convention for this. Either of the two would work fine. Thanks Philip.


Expand icons are hard to see in dark mode

Also, they don't look pretty. Dark mode:

Light mode:

I'd take a PR that fixes this ;)

I have a proof of concept.


web scraper rules should allow for content-encoding conversion

web scraper rules should allow for content-encoding conversion.
If a feed source publishes content in, say, ISO-8859-2 it should be possible to conert it to UTF-8 before being passed on the calling application (eg. miniflux).

@stopped Any content that is fetched from a website by the grabber is automatically converted to UTF-8 for a long time now. I've the impression this ticket is kind of outdated.
Would you please close the ticket!


#94 Update light mode colors for blocks page

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

1 of 2 (50.0%)  changed or added relevant lines in 2 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-0.005%) to 73.168%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

apps/staking/src/components/BlocksChart.tsx
0
1
0.0%

Totals

Change from base Build<PHONE_NUMBER>:
-0.005%

Covered Lines:
2664

Relevant Lines:
3461

💛  - Coveralls


upload geojson directly through api

Given the large number of shapes that sometimes are handled, it would be nice to be able to upload a geojson file directly through the api.
Here the option to create names from the attributes of the .geojson file should also be given.

The vandersat api supports adding a single region by
POST https://maps.vandersat.com/api/v2/rois so I think we could implement that endpoint first here. If we first add that functionality, then we can talk about making that user friendly by uploading from shapefile later.
I propose we add a method to the Rois types so that you can upload a new roi like:
rois = Rois.from_geojson(gjson)
vds.rois.extend(rois)

and/or
roi = Roi.from_geojson_feature(gjson_feature)
vds.rois.add(roi)

What do you think about this?

Or we make it a single method (probably better):
# option 1
rois = Rois.from_geojson(gjson)
vds.rois.upload(rois)

# option 2
roi = Roi.from_geojson_feature(gjson_feature)
vds.rois.upload(rois)

I will now work on the part of uploading a geometry from a geojson. I need this for testing the delete method as well. The rest is still up to you.


Add optimized ReadAll function

What does this PR do?
This adds an optimized io.ReadAll that uses a bytes.Buffer + io.Copy
internally, improving the buffer growth ratio over the runtime append
and taking advange of io.WriterTo when available.
The only scenario where this optimized version is slower than io.ReadAll is
when reading < 512 bytes of a reader that does not implement io.WriterTo.
For now I only updated tests to use the new function as updating the code
requires more careful consideration.
While at it, migrate from the deprecated ioutil package to io.
goos: linux
goarch: amd64
pkg: github.com/elastic/elastic-agent-libs/iobuf
cpu: Intel(R) Xeon(R) CPU E5-2697A v4 @ 2.60GHz
BenchmarkReadAll/size_32B/io.ReadAll/WriterTo-32         	 7479658	       162.4 ns/op	     512 B/op	       1 allocs/op
BenchmarkReadAll/size_32B/io.ReadAll/Reader-32           	 7000012	       169.3 ns/op	     512 B/op	       1 allocs/op
BenchmarkReadAll/size_32B/ReadAll/WriterTo-32            	10630838	       112.3 ns/op	     112 B/op	       2 allocs/op
BenchmarkReadAll/size_32B/ReadAll/Reader-32              	 2111246	       567.3 ns/op	    1584 B/op	       3 allocs/op
BenchmarkReadAll/size_64B/io.ReadAll/WriterTo-32         	 7154652	       163.2 ns/op	     512 B/op	       1 allocs/op
BenchmarkReadAll/size_64B/io.ReadAll/Reader-32           	 7223264	       166.1 ns/op	     512 B/op	       1 allocs/op
BenchmarkReadAll/size_64B/ReadAll/WriterTo-32            	10400562	       113.5 ns/op	     112 B/op	       2 allocs/op
BenchmarkReadAll/size_64B/ReadAll/Reader-32              	 2129949	       558.7 ns/op	    1584 B/op	       3 allocs/op
BenchmarkReadAll/size_512B/io.ReadAll/WriterTo-32        	 2843871	       419.1 ns/op	    1408 B/op	       2 allocs/op
BenchmarkReadAll/size_512B/io.ReadAll/Reader-32          	 2871580	       413.1 ns/op	    1408 B/op	       2 allocs/op
BenchmarkReadAll/size_512B/ReadAll/WriterTo-32           	 4976233	       241.5 ns/op	     560 B/op	       2 allocs/op
BenchmarkReadAll/size_512B/ReadAll/Reader-32             	 2183186	       552.9 ns/op	    1584 B/op	       3 allocs/op
BenchmarkReadAll/size_10KB/io.ReadAll/WriterTo-32        	  142633	      8235 ns/op	   46080 B/op	      10 allocs/op
BenchmarkReadAll/size_10KB/io.ReadAll/Reader-32          	  148326	      8229 ns/op	   46080 B/op	      10 allocs/op
BenchmarkReadAll/size_10KB/ReadAll/WriterTo-32           	  574903	      2210 ns/op	   10288 B/op	       2 allocs/op
BenchmarkReadAll/size_10KB/ReadAll/Reader-32             	  147210	      7995 ns/op	   32304 B/op	       7 allocs/op
BenchmarkReadAll/size_100KB/io.ReadAll/WriterTo-32       	   13171	     90853 ns/op	  514304 B/op	      18 allocs/op
BenchmarkReadAll/size_100KB/io.ReadAll/Reader-32         	   12892	     91787 ns/op	  514304 B/op	      18 allocs/op
BenchmarkReadAll/size_100KB/ReadAll/WriterTo-32          	   51472	     22420 ns/op	  106544 B/op	       2 allocs/op
BenchmarkReadAll/size_100KB/ReadAll/Reader-32            	   21568	     55070 ns/op	  261680 B/op	      10 allocs/op
BenchmarkReadAll/size_1MB/io.ReadAll/WriterTo-32         	    1220	    983276 ns/op	 5241098 B/op	      27 allocs/op
BenchmarkReadAll/size_1MB/io.ReadAll/Reader-32           	    1089	    990818 ns/op	 5241100 B/op	      27 allocs/op
BenchmarkReadAll/size_1MB/ReadAll/WriterTo-32            	    4153	    294507 ns/op	 1048627 B/op	       2 allocs/op
BenchmarkReadAll/size_1MB/ReadAll/Reader-32              	    1195	    944781 ns/op	 4193852 B/op	      14 allocs/op

Checklist

[x] My code follows the style guidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have added tests that prove my fix is effective or that my feature works

Related issues

Relates to https://github.com/elastic/beats/issues/36151

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: 4f889c95390dc017e095e2012b4e24b73182bd44

Failed CI Steps

:buildkite: Lint

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: 0b21e0879dea693a30cbcbaff8f338bf1dd1d4c8

Failed CI Steps

:buildkite: Lint

History

:broken_heart: Build #381 failed 4f889c95390dc017e095e2012b4e24b73182bd44

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: e3c48513af3524eb5580ba52406988dc1076c2a3

Failed CI Steps

:buildkite: Lint

History

:broken_heart: Build #382 failed 0b21e0879dea693a30cbcbaff8f338bf1dd1d4c8
:broken_heart: Build #381 failed 4f889c95390dc017e095e2012b4e24b73182bd44

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: 3c0c1ba4f06302818f7241f8f94f2820c8c061f9

Failed CI Steps

:buildkite: Lint

History

:broken_heart: Build #383 failed e3c48513af3524eb5580ba52406988dc1076c2a3
:broken_heart: Build #382 failed 0b21e0879dea693a30cbcbaff8f338bf1dd1d4c8
:broken_heart: Build #381 failed 4f889c95390dc017e095e2012b4e24b73182bd44

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: 92667eabdf83273f8b0f07621ae132177cee68c6

Failed CI Steps

:buildkite: Lint

History

:broken_heart: Build #384 failed 3c0c1ba4f06302818f7241f8f94f2820c8c061f9
:broken_heart: Build #383 failed e3c48513af3524eb5580ba52406988dc1076c2a3
:broken_heart: Build #382 failed 0b21e0879dea693a30cbcbaff8f338bf1dd1d4c8
:broken_heart: Build #381 failed 4f889c95390dc017e095e2012b4e24b73182bd44

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: b98b5b70f7895fe6585d6aeac14ff1e50c80cdc9

Failed CI Steps

:buildkite: Lint

History

:broken_heart: Build #385 failed 92667eabdf83273f8b0f07621ae132177cee68c6
:broken_heart: Build #384 failed 3c0c1ba4f06302818f7241f8f94f2820c8c061f9
:broken_heart: Build #383 failed e3c48513af3524eb5580ba52406988dc1076c2a3
:broken_heart: Build #382 failed 0b21e0879dea693a30cbcbaff8f338bf1dd1d4c8
:broken_heart: Build #381 failed 4f889c95390dc017e095e2012b4e24b73182bd44

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: a9b5abb37f760d31591e9c03e54df02dad5e95c3

Failed CI Steps

:buildkite: Lint

History

:broken_heart: Build #386 failed b98b5b70f7895fe6585d6aeac14ff1e50c80cdc9
:broken_heart: Build #385 failed 92667eabdf83273f8b0f07621ae132177cee68c6
:broken_heart: Build #384 failed 3c0c1ba4f06302818f7241f8f94f2820c8c061f9
:broken_heart: Build #383 failed e3c48513af3524eb5580ba52406988dc1076c2a3
:broken_heart: Build #382 failed 0b21e0879dea693a30cbcbaff8f338bf1dd1d4c8

:green_heart: Build Succeeded

Buildkite Build
Commit: 0a77de62b66240420d12f85e94e2b4de5095a31c

History

:broken_heart: Build #387 failed a9b5abb37f760d31591e9c03e54df02dad5e95c3
:broken_heart: Build #386 failed b98b5b70f7895fe6585d6aeac14ff1e50c80cdc9
:broken_heart: Build #385 failed 92667eabdf83273f8b0f07621ae132177cee68c6
:broken_heart: Build #384 failed 3c0c1ba4f06302818f7241f8f94f2820c8c061f9
:broken_heart: Build #383 failed e3c48513af3524eb5580ba52406988dc1076c2a3

:green_heart: Build Succeeded

Buildkite Build
Commit: 419d269028c628ba318c417cec7dadf7dbd46d9d

History

:green_heart: Build #388 succeeded 0a77de62b66240420d12f85e94e2b4de5095a31c
:broken_heart: Build #387 failed a9b5abb37f760d31591e9c03e54df02dad5e95c3
:broken_heart: Build #386 failed b98b5b70f7895fe6585d6aeac14ff1e50c80cdc9
:broken_heart: Build #385 failed 92667eabdf83273f8b0f07621ae132177cee68c6
:broken_heart: Build #384 failed 3c0c1ba4f06302818f7241f8f94f2820c8c061f9
:broken_heart: Build #383 failed e3c48513af3524eb5580ba52406988dc1076c2a3

:green_heart: Build Succeeded

Buildkite Build
Commit: 7c1a9ba6bd40a0e968af4e37e51dbf332e41aa4a

History

:green_heart: Build #389 succeeded 419d269028c628ba318c417cec7dadf7dbd46d9d
:green_heart: Build #388 succeeded 0a77de62b66240420d12f85e94e2b4de5095a31c
:broken_heart: Build #387 failed a9b5abb37f760d31591e9c03e54df02dad5e95c3
:broken_heart: Build #386 failed b98b5b70f7895fe6585d6aeac14ff1e50c80cdc9
:broken_heart: Build #385 failed 92667eabdf83273f8b0f07621ae132177cee68c6
:broken_heart: Build #384 failed 3c0c1ba4f06302818f7241f8f94f2820c8c061f9

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: 4d5d1da171e0802dfa050c10e6d0e7021d7cbe89

Failed CI Steps

:buildkite: Lint

History

:green_heart: Build #392 succeeded 7c1a9ba6bd40a0e968af4e37e51dbf332e41aa4a
:green_heart: Build #389 succeeded 419d269028c628ba318c417cec7dadf7dbd46d9d
:green_heart: Build #388 succeeded 0a77de62b66240420d12f85e94e2b4de5095a31c
:broken_heart: Build #387 failed a9b5abb37f760d31591e9c03e54df02dad5e95c3
:broken_heart: Build #386 failed b98b5b70f7895fe6585d6aeac14ff1e50c80cdc9
:broken_heart: Build #385 failed 92667eabdf83273f8b0f07621ae132177cee68c6

:hourglass_flowing_sand: Build in-progress, with failures

Buildkite Build
Commit: 11ab9fd1d25a90af685c4f7ca99c2fd24ab698f0

Failed CI Steps

:buildkite: Lint

History

:broken_heart: Build #401 failed 4d5d1da171e0802dfa050c10e6d0e7021d7cbe89
:green_heart: Build #392 succeeded 7c1a9ba6bd40a0e968af4e37e51dbf332e41aa4a
:green_heart: Build #389 succeeded 419d269028c628ba318c417cec7dadf7dbd46d9d
:green_heart: Build #388 succeeded 0a77de62b66240420d12f85e94e2b4de5095a31c
:broken_heart: Build #387 failed a9b5abb37f760d31591e9c03e54df02dad5e95c3

:green_heart: Build Succeeded

Buildkite Build
Commit: 7f4272aab6b276fb8432693e6a4a86cfad43c7d2

History

:broken_heart: Build #405 failed 11ab9fd1d25a90af685c4f7ca99c2fd24ab698f0
:broken_heart: Build #401 failed 4d5d1da171e0802dfa050c10e6d0e7021d7cbe89
:green_heart: Build #392 succeeded 7c1a9ba6bd40a0e968af4e37e51dbf332e41aa4a
:green_heart: Build #389 succeeded 419d269028c628ba318c417cec7dadf7dbd46d9d
:green_heart: Build #388 succeeded 0a77de62b66240420d12f85e94e2b4de5095a31c


Fix issue #572 Enable adding classes before they are available

Enable adding classes that are are not yet available
but are fetched at a later time.
Fixes issue #572

Hi @uberspot, I'm facing a few issues while trying to fix this.

Unit tests work fine but when the tests are run together, it shows the http2: Transport received unsolicited DATA frame; closing connection message and stalls the execution indefinitely
I suspect it is caused by Go trying to fetch the helm dependencies.

When using the --targets flag to specify targets, Kapitan still throws an error if any target exists in the target directory which does not have its classes present locally. This is because of the last function call to load_target_inventory() with ignore_class_notfound=False target_objs = load_target_inventory(inventory_path, updated_targets, ignore_class_notfound=False).
Since the entire inventory is mapped by reclass before looping through selected targets, I could not think of a solution without changing reclass.

Could not find a way to mute reclass from printing warning about class not found
https://github.com/kapicorp/reclass/blob/fb50054d6332167c34dd2ae8b486943dd9c28746/reclass/core.py#L140

Hi @uberspot, I'm facing a few issues while trying to fix this.

Unit tests work fine but when the tests are run together, it shows the http2: Transport received unsolicited DATA frame; closing connection message and stalls the execution indefinitely
I suspect it is caused by Go trying to fetch the helm dependencies.
When using the --targets flag to specify targets, Kapitan still throws an error if any target exists in the target directory which does not have its classes present locally. This is because of the last function call to load_target_inventory() with ignore_class_notfound=False target_objs = load_target_inventory(inventory_path, updated_targets, ignore_class_notfound=False).
Since the entire inventory is mapped by reclass before looping through selected targets, I could not think of a solution without changing reclass.
Could not find a way to mute reclass from printing warning about class not found
https://github.com/kapicorp/reclass/blob/fb50054d6332167c34dd2ae8b486943dd9c28746/reclass/core.py#L140

That does happen when it fetches the http helm dependencies and it seems it can't find the chart that's being asked in code?
I guess this is happening for prometheus 11.3.0 as defined in monitoring.yml. I think this is where we get those charts from https://github.com/helm/charts/blob/master/stable/prometheus/Chart.yaml Maybe it just needs a version bump?

Shouldn't it have downloaded all missing inventories in the first two calls to load_target_inventory (in the while loop that also fetches the remotes?). My assumption was that by the third call to load_target_inventory it would have already fetched all missing inventory dependencies. Are you sure they're downloaded to the correct output folder? Does this happen on local python -m unittest -v run  tests.test_remote_inventory.RemoteInventoryTest runs too?

A warning is not a huge issue at this point. Let's get it working first. :) We could send a commit later on upstream to reclass to make the warning output configurable.

Hi @uberspot, I'm facing a few issues while trying to fix this.

Unit tests work fine but when the tests are run together, it shows the http2: Transport received unsolicited DATA frame; closing connection message and stalls the execution indefinitely
I suspect it is caused by Go trying to fetch the helm dependencies.
When using the --targets flag to specify targets, Kapitan still throws an error if any target exists in the target directory which does not have its classes present locally. This is because of the last function call to load_target_inventory() with ignore_class_notfound=False target_objs = load_target_inventory(inventory_path, updated_targets, ignore_class_notfound=False).
Since the entire inventory is mapped by reclass before looping through selected targets, I could not think of a solution without changing reclass.
Could not find a way to mute reclass from printing warning about class not found
https://github.com/kapicorp/reclass/blob/fb50054d6332167c34dd2ae8b486943dd9c28746/reclass/core.py#L140

That does happen when it fetches the http helm dependencies and it seems it can't find the chart that's being asked in code?
I guess this is happening for prometheus 11.3.0 as defined in monitoring.yml. I think this is where we get those charts from https://github.com/helm/charts/blob/master/stable/prometheus/Chart.yaml Maybe it just needs a version bump?
Shouldn't it have downloaded all missing inventories in the first two calls to load_target_inventory (in the while loop that also fetches the remotes?). My assumption was that by the third call to load_target_inventory it would have already fetched all missing inventory dependencies. Are you sure they're downloaded to the correct output folder? Does this happen on local python -m unittest -v run  tests.test_remote_inventory.RemoteInventoryTest runs too?
A warning is not a huge issue at this point. Let's get it working first. :) We could send a commit later on upstream to reclass to make the warning output configurable.

The issue arises if suppose there are three targets (a,  b,  c) and we specify selected targets with  $ kapitan compile --fetch -t a b. load_target_inventory function maps the entire inventory so all three targets are checked for missing classes. This is fine as long as ignore_class_notfound=True,  but in the last call we set ignore_class_notfound=False which raises the error of class not found for c.

For this reason, I made a separate environment with just one target which fetches its class, the unit test python -m unittest -v run tests.test_remote_inventory.RemoteInventoryTest worked fine.


do we need a data dictionary as we did for safe models?

if so, are there existing standards we should be adopting?
cf Deutsche Bank semantic mappings (Jim to dig out emails)

Depends on what the output checkers do in practice


Fixed german translation typo

Thank you for contributing to Homarr! So that your Pull Request can be handled effectively, please populate the following fields (delete sections that are not applicable)
Category
Translation
Overview
Fixed a little typo in the german translation.

Hello, translations are meant to be done on crowdin. I don't know if crowdin will correctly load the changes if I apply this. Can you correct it there instead?


Warning while loading framework and some other questions about output

Hi there,
I downloaded the latest version of Counterfit last week and installed all the modules required but still have some problems. When I executed the command 'load art' I got a warning:
load art
The type of the provided estimator is not yet support for automated setting of logits difference loss. Therefore, this attack is defaulting to attacking the loss provided by the model in the provided estimator.
[+] art successfully loaded with defaults (no config file provided)
which did not exist before. When I executed the 'run' command I only got the adversarial input:
run
[-] Running attack HopSkipJump with id 12a70390 on creditfraud)
[-] Preparing attack...
[-] Running attack...
┌─────────┬──────────────┬──────────────────────────┐
│ Success │ Elapsed time │ Total Queries            │
├─────────┼──────────────┼──────────────────────────┤
│ 1/1     │ 4.3          │ 24550 (5740.6 query/sec) │
└─────────┴──────────────┴──────────────────────────┘
┌┬┬┬┬────────────────────────────────────────────────────────────────────────┬┐
│││││ Adversarial Input                                                      ││
├┼┼┼┼────────────────────────────────────────────────────────────────────────┼┤
│││││ [4462.00 -2.30 1.76 -0.36 2.33 -0.82 -0.07 0.56 -0.40 -0.24 -1.53 2.03 ││
│││││ -6.56 0.17 -1.47 -0.70 -2.28 -4.78 -2.62 -1.34 -0.43 -0.30 -0.93 0.17  ││
│││││ -0.09 -0.15 -0.54 0.04 -0.15 239.93]                                   ││
└┴┴┴┴────────────────────────────────────────────────────────────────────────┴┘
[+] Attack completed 12a70390 (HopSkipJump)
there are some differences in the scan summary as well (no 'queries'):
Additionally, could you please explain some meaning of values in the scan summary and the running output? Could you please tell me what does it mean by 'successes'? When can we say an attack is a 'success' or 'failure'? I guess that 'best score' means the success percentage of samples in an attack, is it correct?
In the running output, I guess the sample index means the number of samples in the attack right? What is the meaning of label and attack label? What is the meaning of % Eucl. dist. and  Elapsed Time [sec]? I think 'queries' means the number of the attack on target, is it correct? I saw a list of decimal numbers in the adversarial input value, are they only random numbers or they have some similarities? Where are they from? Do they have some relations with my attack type?
Thank you very much for your help and patience.

Hi @jiansuozhe, thanks for your questions.
In v1.0 art is loaded dynamically and this warning comes from art, The type of the provided estimator is not yet support for automated setting of logits difference loss. Therefore, this attack is defaulting to attacking the loss provided by the model in the provided estimator..
scan and run are two separate commands with two mostly distinct purposes. scan is for "fuzzing", where run is for more manual testing. With scan you will get more metrics that are useful for baselining, versus run where you only really care about the output that you generate.
Defining what is a success or failure is going to depend on the attack and framework you use. For example, in art.py, [check_success](https://github.com/Azure/counterfit/blob/5e385b0a6cf80e90bea76507ec1cdef2c85cea2b/counterfit/frameworks/art/art.py#L480)  uses the Adversarial Robustness Toolbox function to define "success" for both evasion attacks and extraction attacks. In  augly.py, we just make our own function. It's really up to you how you want to define success, the CFAttack object you pass to reporting.py will have everything you need.

best_score is the attack that generates highest confidence when switching a label, and does so with the least number of queries.
sample_index is the index of the sample from your target.X. During target.load(), samples are loaded as a list into self.X. CF will reference this list to get samples for an attack.
label is the initial label for a sample, before any modifications have been made.
attack_label is the final label after an attack has completed.
Eucl dist. is the % change in the image from the original input to the final output.
Elapsed time is how long the attack took in seconds.
Queries is the number of queries it took to complete the attack. (lower the better)
Adversarial Input is the final output from an attack. Here it is a bunch of numbers because it's the creditfraud model. If you did the satellite demo, it would be an image. They are effectively a modified input sample.  All samples get loaded when you interact with a target (creditfraud.py).

Hopefully this is helpful!

Thank you very much for your help @moohax

Please don't hesitate to ask more questions!

Hello @moohax,
Could you please explain to me why I only got the adversarial input in my running output? Is it because of the estimator?
run
[-] Running attack HopSkipJump with id 12a70390 on creditfraud)
[-] Preparing attack...
[-] Running attack...
┌─────────┬──────────────┬──────────────────────────┐
│ Success │ Elapsed time │ Total Queries │
├─────────┼──────────────┼──────────────────────────┤
│ 1/1 │ 4.3 │ 24550 (5740.6 query/sec) │
└─────────┴──────────────┴──────────────────────────┘

Additionally, could you please tell me how can we extract essential information from the adversarial input? For instance, find the useful numbers in a bunch of numbers to evaluate the model? @moohax

@jiansuozhe That's what run provides. Compare the input and output with predict -a and predict -i <sample_index>. You can trace into reporting to customize these reports.
In terms of "evaluating a model". Counterfit is largely designed as a red team tool, and the traditional sort of "robustness" testing is not necessarily a feature that we put front and center. For this type of reporting, I would dig into what art proper has and add those functions or elements to art.py in  post_attack_processing.

Hello @moohax,
Thank you for your reply. You mean that Counterfit is developed to test the protection level of system and find the leaks right？Could you please tell me how to realize this function？For example, I run an attack on a target and get the running output, I should be able to get some useful information from the output, is it correct? Can I get some useful information, for instance where are the leaks in my AI system or how to improve my AI algorithm to make it safer, from my output? Or I can only get the feedback like "my system is not safe when facing evasion attack" or something like this. Thank you.

The useful information is the output. If there is some metric or some output you would like to see, please let us know.
You could collect all of the outputs (Adversarial Inputs) and use them in an adversarial retraining scheme. But Counterfit has no official retraining mechanism built in. It could be done by adding training code to your target, calling train() in the targets load() function, then reloading the target. Again, that is unofficial and your milage may vary.
To explore targets and the completed attacks, from the counterfit> terminal, drop into an IPython shell and import CFState.
ipy
>> from counterfit.core.state import CFState
>> CFState.state().targets
>>  CFState.state().active_target.attacks

Hello @moohax,
I found that when running HopSkipJump I can get the output, but when running the other attacks I only got the bugs. For instance, when running BoundaryAttack I got "Result too large", when running BasicIterativeMethod I got "no attribute 'predict wrapper'". Additionally, the most frequent problem is "object of type 'NoneType' has no len()". Is it because the input data(.npz) and the model file(.pkl) you provided can only be used in HopSkipJump? Or I need to switch my target? Thank you.

@moohax, additionally, I have never created a new input data file before. Could you please give me some tips on how to create an input file (.npz)? Thank you.

@jiansuozhe
Each attack has varying requirements. The Boundary Attack likely ran successfully, but the output may have been too big for some auxiliary process. You can trace through counterfit.frameworks.art.post_attack_processing() or check_success() in that same module.
A helpful debugging thing is to put from IPython import embed; embed() into some function you want to examine during runtime. It will drop you into an IPython terminal that allows you to explore the current state. A more advanced debugging alternative is from IPython.core.debugger import set_trace; set_trace(), this will give you pdb style debugging.
You may need to switch the target, an attack can be either open-box (you have the model file), or closed-box (you have access to inference only). Hop Skip Jump is a closed-box attack and the Basic Iterative Method is an open-box attack. The implication is that the backend framework Adversarial Robustness Toolbox requires an estimator/classifier that inherits from  CLASSIFIER_LOSS_GRADIENTS_TYPE.
Counterfit passes everything back to the framework to be built and run. The targets provided are for demo purposes, and we artificially force a particular ART loading process a target_classifier attribute attached to the target for testing purposes.
For example, digits_keras  vs digits_blackbox
If you provide no target_classifier it will assume you are using a closed-box attack. As all of targets have model files, you can use open-box (whitebox) attacks against them. However, depending on the attack, you may need to provide additional items. We tend to focus on closed-box (blackbox) attacks.

Additionally, the most frequent problem is "object of type 'NoneType' has no len()"

I run into this, It's a bug when the attack fails to run. Because the attack fails to run, results never get set, and then successes can't be properly calculated and reported.

Hello @moohax,
I loaded the framework art and interacted the target satellite, but I found that almost all the attacks did not work. The most frequent two questions are the following:
[-] Preparing attack...
[-] Running attack...
[!] Failed to run ee34d02c (ZooAttack): 'BlackBoxClassifier' object has no attribute 'channels_first'
Even if I interacted the target digits_blackbox the problem still occur. Could you please tell me where is the BlackBoxClassifier object and how can I fix it? Or I should not run the attacks like this? Thank you.
The second problem is like following:

Could you please tell me how to fix it? Thank you.

Hello @moohax,
I found that if I do not use the latest version of counterfit, my attacks really worked. When I interacted the target tutorial, all the attacks worked. When I interacted the target satelliteimages, only the pixel attack and the threshold attack did not run properly. When running pixel attack, the problem was similar as before (no attribute XXX), when running threshold attack, the problem is like follows:

I do not know if I can fix it by changing the settings of my system.
Now that I would like to utilize counterfit to develop a system testing the security of AI models those are used to classify images, could you please tell me if I just need to consult the target tutorial and satelliteimages to design my own target? Thank you.

Nice work! (I know it doesn't seem like it).
Failed to draw an adversarial image... is the Adversarial Robustness Toolbox saying the attack failed. My recommendation is to use Hop Skip Jump as it is Boundary Attack 2.0. In a not too distant update (internal at the moment) you will be able to optimize attack parameters.
The memory allocation looks like a bug, seems as though the target is trying to process ALL images in the dataset as a sample. Double check to see if self.X is a list of lists after you load. Its often helpful to set a breakpoint ater self.X gets loaded and explore the data to make sure it's as you expect. Same advice for your predict function.

Hello @moohax,
I downloaded the latest version of Counterfit and found that I could not load from config.json. Could you please tell me how to deal with this problem? Thank you.

This is just a warning. You can provide a config that would limit the available attacks, or provide defaults. Otherwise Counterfit will just dynamically load all attacks.
Each respective framework implementation can be found under the  folder named after the framework, art.py for example. This will give you insight into how it all gets loaded.


fix: undefined translation word(s)

fixed translation map containing words mapped to undefined, because some languages have more words set in gherkin-languages.json. And because this is working with the same index, it was possible that it would map a translation to undefined.
Fixed this by adding a defaultWordIndex, when one is found. And uses this when no translationWord is available by index.
I cant really create a test for this atm, because this is a non-exported function.
I could move this logic to a seperate file and make a unittest for this behavoir checking all languages to be translate correctly to an english translation.
Where can I place this test? Besides the code (.spec.ts or .unit.ts) or a seperate /test folder? There is no current structure for that I think.

Thanks, this looks straightforward enough, so I merged it for inclusion in the upcoming v4.
As for tests, using the examples as tests are low hanging fruit, but you're right that this project could use some unit tests as well. I suppose there's a lot of technical debt in that regard, but if you're inclined to create another PR for a specs directory with some Jest unit tests for this particular feature, that would be a good start.

Thanks for the quick merge :)
I'll create a new pr soon for some unittests


Release 2.1.0

Release https://github.com/finos/symphony-bdk-java/milestone/1 to Maven Central.

Release created https://github.com/finos/symphony-bdk-java/releases/tag/2.1.0


NWAC Weather Forecast 500

 WARN  [2023-06-05T14:48:07.757Z] WARN error response on fetch error: {"code":"internal_server_error","message":"
There has been a critical error on this website.

Learn more about troubleshooting WordPress.
","data":{"status":500},"additional_errors":[]} params: {"zone_id":1140,"published_datetime":"2023-06-05T14:48:06Z"} query: ["nwac-weather",{"host":"https://nwac.us","zone_id":1140,"requestedTime":"2023-06-05 morning"}] status: 500 url: "https://nwac.us/api/v1/mountain-weather-region-forecast" what: "NWAC weather forecast"

dupe of #280


[WIP] Add additional linting to package

This pull request is to improve the linting for the package in response to issue #105 in ODSSM.
The current PR includes changes resulting the application of isort and black and small change in setup.py to improve the robustness of the version check for the C++ complier (-dumpversion vs. --version) .  flake8 compliance is a work in progress.  flake8 is currently configured in setup.cfg to ignore E501 (line length), E226 (lack of white space around binary operators), and E503 (line break before binary operator, but other errors remain that I'd like feedback on:
ocsmesh/cmd.py:404:9: F841 local variable 'config_outputs' is assigned to but never used
ocsmesh/cmd.py:442:9: F841 local variable 'opts' is assigned to but never used
ocsmesh/utils.py:1089:5: F841 local variable 'y' is assigned to but never used
ocsmesh/utils.py:1097:5: F841 local variable 'faces_around_vert' is assigned to but never used
ocsmesh/utils.py:1106:5: F841 local variable 'coord' is assigned to but never used
ocsmesh/utils.py:1112:5: F841 local variable 'shared_edges' is assigned to but never used
ocsmesh/raster.py:828:5: F841 local variable 'win_h' is assigned to but never used
ocsmesh/raster.py:829:5: F841 local variable 'win_w' is assigned to but never used
ocsmesh/mesh/mesh.py:795:9: F841 local variable 'coo_to_idx' is assigned to but never used
ocsmesh/features/constraint.py:77:9: F841 local variable 'bound_values' is assigned to but never used
ocsmesh/cli/mesh_upgrader.py:82:9: E266 too many leading '#' for block comment
ocsmesh/cli/mesh_upgrader.py:89:9: E266 too many leading '#' for block comment
ocsmesh/cli/remesh.py:308:9: F841 local variable 'roi_s' is assigned to but never used
ocsmesh/cli/remesh.py:316:9: F841 local variable 'vert_idx_to_refin' is assigned to but never used
ocsmesh/cli/remesh_by_shape_factor.py:236:13: F841 local variable 'vert_in' is assigned to but never used
ocsmesh/geom/collector.py:243:17: F841 local variable 'level0' is assigned to but never used
ocsmesh/geom/collector.py:244:17: F841 local variable 'level1' is assigned to but never used
ocsmesh/ops/__init__.py:4:1: E731 do not assign a lambda expression, use a def
ocsmesh/ops/__init__.py:6:1: E731 do not assign a lambda expression, use a def
ocsmesh/ops/combine_geom.py:438:13: E722 do not use bare 'except'
ocsmesh/hfun/collector.py:125:9: F841 local variable 'srcs' is assigned to but never used
ocsmesh/hfun/mesh.py:143:9: F841 local variable 'coords' is assigned to but never used

Once the flake8 issue is resolved, I'd be in favor of integrating tests for isort, black, and flake8 as part of the Github Action workflow for testing.

@SorooshMani-NOAA I'd like your feedback specifically about how to handle the remaining errors and your thoughts about integrating tests for these in the Github Action testing workflow.

For the question of those specific errors (line numbers are based on files in the pull request branch):

ocsmesh/cmd.py:404:9: You can comment the line, I haven't visited this part of the code
ocsmesh/cmd.py:442:9: You can comment the line, I haven't visited this part of the code
ocsmesh/utils.py:1089:5: Please comment the line, I need to revisit later
ocsmesh/utils.py:1097:5: Please comment the line, I need to revisit later
ocsmesh/utils.py:1106:5: Go ahead and remove the unused assignment line
ocsmesh/utils.py:1112:5: Go ahead and remove the unused assignment line
ocsmesh/raster.py:828:5: Remove the assignment but add a comment saying win height is equal to that value
ocsmesh/raster.py:829:5: Remove the assignment but add a comment saying win width is equal to that value
ocsmesh/mesh/mesh.py:795:9: Go ahead and remove it
ocsmesh/features/constraint.py:77:9: Please comment the line, I need to revisit this
ocsmesh/cli/mesh_upgrader.py:82:9: Go ahead and fix the double #
ocsmesh/cli/mesh_upgrader.py:89:9: Go ahead and fix the double #
ocsmesh/cli/remesh.py:308:9: You can remove the unused variable and the other relevant line (307, 308)
ocsmesh/cli/remesh.py:316:9: You can remove the unused variable and the other relevant line (315, 316)
ocsmesh/cli/remesh_by_shape_factor.py:236:13:  You can remove the unused variable and the other relevant line (235, 236)
ocsmesh/geom/collector.py:243:17: This is a bug, level1 and level0 must be passed to FilledContour at 251
ocsmesh/geom/collector.py:244:17: This is a bug, level1 and level0 must be passed to FilledContour at 251
ocsmesh/ops/__init__.py:4:1: It's OK to replace with def but I wanted to be compact
ocsmesh/ops/__init__.py:6:1: It's OK to replace with def but I wanted to be compact
ocsmesh/ops/combine_geom.py:438:13: I need to check what errors could occur, can we ignore E722 only for this line?
ocsmesh/hfun/collector.py:125:9: Please comment the srcs line, I need to revisit this
ocsmesh/hfun/mesh.py:143:9: Please go ahead and remove the unused var line


Removed EmptyCache field from DNSCache

Java 8 changed the signature of ConcurrentHashMap.keySet(), breaking compilation of javax.jmdns.impl.DNSCache. Considering that there are no consumers of this field within the project, and the class that contains it is in a impl package, removing it is the simplest option.
Fixes #15
Signed-off-by: Andy Lintner<EMAIL_ADDRESS>(github: beowulfe)

Removing it was the cleanest solution - it looks like it was probably leftover code from an earlier revision, before it was converted to use ConcurrentHashMap, but I didn't trace the history. As far as optimizations go, it's not a super useful one - there's only one DNSCache created for each instance of JmDNSImpl.
I did a cursory search of open source projects using this library and none are directly accessing this field. It feels safe to me, but if someone has a good use case for providing the static empty, I can revisit this with a more complex solution.

I agree this is really just a left over from old habits…
Pierre

On Feb 8, 2015, at 20:17, Andy Lintner<EMAIL_ADDRESS>wrote:
Removing it was the cleanest solution - it looks like it was probably leftover code from an earlier revision, before it was converted to use ConcurrentHashMap, but I didn't trace the history. As far as optimizations go, it's not a super useful one - there's only one DNSCache created for each instance of JmDNSImpl.
I did a cursory search of open source projects using this library and none are directly accessing this field. It feels safe to me, but if someone has a good use case for providing the static empty, I can revisit this with a more complex solution.
—
Reply to this email directly or view it on GitHub https://github.com/openhab/jmdns/pull/17#issuecomment-73455572.

Great, thanks!
So this was the only issue for Java8? Does all compile nicely now?

Yes, compiles cleanly in Java8 now.


Error while tuning

I did a "create" and a "tune" on these data few weeks ago, without problem.
Having overwritten the engine by error, I just did a new "create" and a new "tune" on the same data. But, now, I get this error, in 2 "tune" attempts:
INFO: (1 of 4) Corpora tokenization...                                 DONE (in 6s)
INFO: (2 of 4) Merging corpus...                                       DONE (in 0s)
INFO: (3 of 4) Tuning...                                               DONE (in 336s)
ERROR Unexpected exception:
Command '/home/dev8/mmt/cli/opt/mert-moses.perl /home/dev8/mmt/runtime/FREN/tmp/tuning/corpus.fr /home/dev8/mmt/runtime/FREN/tmp/tuning/corpus.en /home/dev8/mmt/cli/opt/mertinterface.py /tmp/tmp0lkgHL --threads 16 --mertdir /home/dev8/mmt/build/bin --mertargs '--binary --sctype BLEU' --working-dir /home/dev8/mmt/runtime/FREN/tmp/tuning/mert --nbest 100 --decoder-flags "--port 8045" --nonorm --closest --no-filter-phrase-table --bleuscorer /home/dev8/mmt/cli/opt/mmt-bleu.perl --bleuscorer-flags "-nt" --early-stopping-value 1 --predictable-seeds --maximum-iterations=25' failed with exit code 2
The model is running, and works fine. It's just not tunable...

Hi @EtienneAb3d,
We have tried to perform an mmt create and tune on an en-fr corpus, but unfortunately we were not able to replicate your issue in our environment yet.
Could you please send me the content of your <your_mmt_root>/runtime/<engine_name>/logs/node.log file? It should contain more detailed information on the problem you have encountered.
Thanks for your patience.
Andrea

Hi @EtienneAb3d ,
Could you also try to perform tune with command ./mmt tune -e <your_engine_name> --debug?
This way you should also find in your logs folder the mert.log file, that is a specific tuning log.
It would be very helpful if you could sent me that log too.
Andrea

It seems it failed when trying to translate a VERY long sentence. Certainly, for the tuning, the set of used sentences are randomly chosen in the "create" process ? This could explain that I didn't get this problem at the first create/tune.
...

run decoder to produce n-best lists
params = --port 8045
decoder_config = -weight-overwrite 'Distortion0= 0.033556 Sapt= 0.027740 0.039156 0.004247 0.012173 InterpolatedLM= 0.088372 DM0= 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0
.067011 0.030089 WordPenalty0= -0.075074 PhrasePenalty0= -0.137940'
Traceback (most recent call last):
File "/home/dev8/mmt/cli/opt/mertinterface.py", line 178, in
translator.run()
File "/home/dev8/mmt/cli/opt/mertinterface.py", line 119, in run
translation = translation_job.get()
File "/home/dev8/mmt/cli/libs/multithread.py", line 289, in process
result = self._func(*self._args, **self._kwds)
File "/home/dev8/mmt/cli/opt/mertinterface.py", line 56, in _get_translation
translation = Api.translate(line, context=context_vector, nbest=nbest)
File "/home/dev8/mmt/cli/cluster.py", line 131, in translate
return self._get('translate', params=p)
File "/home/dev8/mmt/cli/cluster.py", line 63, in _get
return self._unpack(r)
File "/home/dev8/mmt/cli/cluster.py", line 55, in _unpack
raise Exception('HTTP request failed with code ' + str(r.status_code) + ': ' + r.url)
Exception: HTTP request failed with code 400: http://localhost:8045/translate?q=De+souligner+qu'+il+importe+de+poursuivre+les+efforts+visant+à+éliminer+les+obstacles+à+
la+promotion+et+au+d%C3%A9veloppement+de+la+coop%C3%A9ration+afro-arabe+et+d%27+organiser+les+r%C3%A9unions+de+ses+instances+comp%C3%A9tentes+dans+ce+domaine+%2C+compte+tenu+des+r%C3%A9
solutions+adopt%C3%A9es+par+le+Conseil+de+la+Ligue+%2C+et+de+prier+le+Secr%C3%A9taire+g%C3%A9n%C3%A9ral+de+maintenir+les+contacts+%C3%A0+cet+effet+en+vue+de+parvenir+%C3%A0+une+coop%C3%
A9ration+effective+et+mutuellement+b%C3%A9n%C3%A9.....[CUT BY ME]...

Trying to do a new create+tune, I still got the same error...
:-/

Hi Etienne,
sorry for the delayed response, I'm out of office right now.
The data selection for tuning and evaluation is deterministic, this means that even after a complete re-creation the engine will select the same lines for tuning set.
What you can do is open the data inside "engines/<your_engine>/data/dev" e manually remove the problematic lines. Please remember also to remove the parallel line in the other language file.
You can also use your own dev set if you prefer, just invoke the tuning command like this:
./mmt tune --path /path/to/your/data
Please let me know if this solves your issue or if you need further support.
Best,
Davide

I am getting similar issue. Tune is dying here (mert.log)
decoder_config = -weight-overwrite 'WordPenalty0= -0.075074 PhrasePenalty0= -0.137940 Sapt= 0.027740 0.039156 0.004247 0.012173 InterpolatedLM= 0.088372 Distortion0= 0.033556 DM0= 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0.067011 0.030089'
Traceback (most recent call last):
File "/opt/datafs/ModernMT/cli/opt/mertinterface.py", line 178, in
translator.run()
File "/opt/datafs/ModernMT/cli/opt/mertinterface.py", line 119, in run
translation = translation_job.get()
File "/opt/datafs/ModernMT/cli/libs/multithread.py", line 289, in process
result = self._func(*self._args, **self._kwds)
File "/opt/datafs/ModernMT/cli/opt/mertinterface.py", line 58, in _get_translation
nbest_list = sorted(translation['nbest'], key=lambda hypo: hypo['totalScore'], reverse=True)
KeyError: 'nbest'
Exit code: 1

Looks like my issue was related to #253
I have found a empty line on my dev set and removed.
It always stopped on "run1. Now it 's on run2 already.

Hi @rptl,
is your tune working properly after removing the empty line?
Andrea

Hey @AndRossi, thanks for following up!
Instead of removing, I have replaced it empty by a single word on both  source and TARGET. Worked fine.

I'm glad now it works fine!
Since this issue seems solved, I'm closing it now.
For any question or doubt, however, don't hesitate to reopen it.
Have a wonderful day!
Andrea

@rptl @EtienneAb3d
We are going to solve both issues in the next days, thanks for your patience! :)

Both problems have been fixed and they are available in our master branch with commit https://github.com/ModernMT/MMT/commit/a448e9ef21f0a3feadcf1d7ff3e3ad4f9db4aa3a
Thank you for your support! I'm closing the issue right now but please, don't hesitate to re-open it if you need to.
Thanks

Hi Davide,
I am opening this because I am having a tune error. I thought it's better to keep everything related to this issue in one thread. Please let me know if I should create a new issue.
Here is the error I am getting:

============ TUNING STARTED ============

ENGINE:  default
CORPORA: /root/ModernMT/engines/default/data/dev (10 documents)
LANGS:   en > ar
INFO: (1 of 4) Corpora tokenization...                                 DONE (in 6s)
INFO: (2 of 4) Merging corpus...                                       DONE (in 0s)
INFO: (3 of 4) Tuning...                                               DONE (in 6s)
ERROR Unexpected exception:
Command '/root/ModernMT/cli/opt/mert-moses.perl /root/ModernMT/runtime/default/tmp/tuning/corpus.en /root/ModernMT/runtime/default/tmp/tuning/corpus.ar /root/ModernMT/cli/opt/mertinterface.py /tmp/tmpQb1b7Y --threads 4 --mertdir /root/ModernMT/build/bin --mertargs '--binary --sctype BLEU' --working-dir /root/ModernMT/runtime/default/tmp/tuning/mert --nbest 100 --decoder-flags "--port 8045" --nonorm --closest --no-filter-phrase-table --predictable-seeds --maximum-iterations=25' failed with exit code 2
and here is the output of
Using SCRIPTS_ROOTDIR: /root/ModernMT/cli/opt Asking moses for feature names and values from /tmp/tmpQb1b7Y Executing: /root/ModernMT/cli/opt/mertinterface.py --port 8045 -config /tmp/tmpQb1b7Y -show-weights exec: /root/ModernMT/cli/opt/mertinterface.py --port 8045 -config /tmp/tmpQb1b7Y -show-weights Executing: /root/ModernMT/cli/opt/mertinterface.py --port 8045 -config /tmp/tmpQb1b7Y -show-weights > ./features.list 2> /dev/null MERT starting values and ranges for random generation:     DM0 =   0.015 ( 0.00 ..  1.00)     DM0 =   0.018 ( 0.00 ..  1.00)     DM0 =   0.042 ( 0.00 ..  1.00)     DM0 =   0.020 ( 0.00 ..  1.00)     DM0 =   0.262 ( 0.00 ..  1.00)     DM0 =   0.127 ( 0.00 ..  1.00)     DM0 =   0.067 ( 0.00 ..  1.00)     DM0 =   0.030 ( 0.00 ..  1.00)   Distortion0 =   0.034 ( 0.00 ..  1.00)   InterpolatedLM =   0.088 ( 0.00 ..  1.00)   PhrasePenalty0 =  -0.138 ( 0.00 ..  1.00)    Sapt =   0.028 ( 0.00 ..  1.00)    Sapt =   0.039 ( 0.00 ..  1.00)    Sapt =   0.004 ( 0.00 ..  1.00)    Sapt =   0.012 ( 0.00 ..  1.00)   WordPenalty0 =  -0.075 ( 0.00 ..  1.00) featlist: DM0=0.015334  featlist: DM0=0.018113  featlist: DM0=0.042342  featlist: DM0=0.020316  featlist: DM0=0.261833  featlist: DM0=0.126704  featlist: DM0=0.067011  featlist: DM0=0.030089  featlist: Distortion0=0.033556  featlist: InterpolatedLM=0.088372  featlist: PhrasePenalty0=-0.13794  featlist: Sapt=0.02774  featlist: Sapt=0.039156  featlist: Sapt=0.004247  featlist: Sapt=0.012173  featlist: WordPenalty0=-0.075074  run 1 start at Wed Sep  6 13:50:08 MDT 2017 Parsing --decoder-flags: |--port 8045| Saving new config to: ./run1.moses.ini Saved: ./run1.moses.ini Normalizing lambdas: 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0.067011 0.030089 0.033556 0.088372 -0.13794 0.02774 0.039156 0.004247 0.012173 -0.075074 DECODER_CFG = -weight-overwrite 'Sapt= 0.027740 0.039156 0.004247 0.012173 PhrasePenalty0= -0.137940 DM0= 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0.067011 0.030089 WordPenalty0= -0.075074 Distortion0= 0.033556 InterpolatedLM= 0.088372' Executing: /root/ModernMT/cli/opt/mertinterface.py --port 8045  -config /tmp/tmpQb1b7Y -weight-overwrite 'Sapt= 0.027740 0.039156 0.004247 0.012173 PhrasePenalty0= -0.137940 DM0= 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0.067011 0.030089 WordPenalty0= -0.075074 Distortion0= 0.033556 InterpolatedLM= 0.088372'  -n-best-list run1.best100.out 100 distinct  -input-file /root/ModernMT/runtime/default/tmp/tuning/corpus.en > run1.out  Executing: /root/ModernMT/cli/opt/mertinterface.py --port 8045  -config /tmp/tmpQb1b7Y -weight-overwrite 'Sapt= 0.027740 0.039156 0.004247 0.012173 PhrasePenalty0= -0.137940 DM0= 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0.067011 0.030089 WordPenalty0= -0.075074 Distortion0= 0.033556 InterpolatedLM= 0.088372'  -n-best-list run1.best100.out 100 distinct  -input-file /root/ModernMT/runtime/default/tmp/tuning/corpus.en > run1.out (1) run decoder to produce n-best lists params = --port 8045 decoder_config = -weight-overwrite 'Sapt= 0.027740 0.039156 0.004247 0.012173 PhrasePenalty0= -0.137940 DM0= 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0.067011 0.030089 WordPenalty0= -0.075074 Distortion0= 0.033556 InterpolatedLM= 0.088372' Traceback (most recent call last):   File "/root/ModernMT/cli/opt/mertinterface.py", line 178, in <module>     translator.run()   File "/root/ModernMT/cli/opt/mertinterface.py", line 119, in run     translation = translation_job.get()   File "/root/ModernMT/cli/libs/multithread.py", line 289, in process     result = self._func(*self._args, **self._kwds)   File "/root/ModernMT/cli/opt/mertinterface.py", line 56, in _get_translation     translation = Api.translate(line, context=context_vector, nbest=nbest)   File "/root/ModernMT/cli/cluster.py", line 129, in translate     p['context_vector'] = self._encode_context(context)   File "/root/ModernMT/cli/cluster.py", line 101, in _encode_context     ) for el in context]) KeyError: 'domain' Exit code: 1 The decoder died. CONFIG WAS -weight-overwrite 'Sapt= 0.027740 0.039156 0.004247 0.012173 PhrasePenalty0= -0.137940 DM0= 0.015334 0.018113 0.042342 0.020316 0.261833 0.126704 0.067011 0.030089 WordPenalty0= -0.075074 Distortion0= 0.033556 InterpolatedLM= 0.088372'

Hello @mzeidhassan,
I'm glad to help.
Which version of MMT are you using at the moment?
Furthermore, could you please send me the whole logs folder (<your_mmt_home>/runtime/<your_engine_name>/runtime/logs) as a zip file?
That would help me a lot.
Thanks for your patience!
Andrea

Hi @mzeidhassan
on a second thought, it would be better to open a different issue because your problem, on a first glance, seems different from the original one. I will also rename this issue to better identify the problem.
Thanks for your comprehension!
Davide


Query: Nested Where->Count query crashes when done in two operations

My real-life scenario is a DB with users and teams, where users have a reference to the team they are in; I'd like to get all teams T where the number of users in T is less than a certain number.
A simplified (hopefully minimal) repro is below - as you can see, doing this in one operation (.Where(...).Count()) works fine, but doing a Select first (which is convenient so I can get the object itself and not just the count of related objects) and then a Count fails. But only if it's in a Where, using a Select with the same condition works fine. Also, the in-memory and SQLite providers differ in their error messages for one case, but not for a very close query that also returns an error.
Steps to reproduce
Full repro, including queries that do not crash even though they're pretty close:
using System.Linq;
using Microsoft.EntityFrameworkCore;

class Program
{
    class A
    {
        public string Id { get; set; }
    }

    class Context : DbContext
    {
        public DbSet<A> As { get; set; }

        protected override void OnConfiguring( DbContextOptionsBuilder optionsBuilder )
        {
            optionsBuilder.UseInMemoryDatabase("test");
            //optionsBuilder.UseSqlite( "Data Source=test" );
        }
    }

    static void Main( string[] args )
    {
        var context = new Context();
        context.Database.EnsureCreated();

        // OK
        context.As.Select( a => context.As.Where( a2 => a2.Id == "a" ).Count() )
                  .ToArray();

        // OK
        context.As.Where( a => context.As.Where( a2 => a2.Id == "a" ).Count() == 0 )
                  .ToArray();

        // OK
        context.As.Select( a => context.As.Where( a2 => a2.Id == "a" ) )
                  .Select( x => x.Count() )
                  .ToArray();

        // OK
        context.As.Select( a => context.As.Where( a2 => a2.Id == "a" ) )
                  .Select( x => x.Count() == 0 )
                  .ToArray();

        // Fails on SQLite: 'must be reducible node'
        // Fails on InMemory: 'variable 'a2' of type 'Microsoft.EntityFrameworkCore.Storage.ValueBuffer' referenced from scope '', but it is not defined'
        context.As.Select( a => context.As.Where( a2 => a2.Id == "a" ) )
                  .Where( x => x.Count() == 0 )
                  .ToArray();

        // Fails on both: 'variable 'a2' of type 'Microsoft.EntityFrameworkCore.Storage.ValueBuffer' referenced from scope '', but it is not defined'
        context.As.Select( a => context.As.Where( a2 => a2 != null ) )
                  .Where( x => x.Count() == 0 )
                  .ToArray();
    }
}

Further technical details
EF Core version: 2.0.0
Database Provider: InMemory and SQLite (I haven't tested with others)
Operating system: Windows 10 (15063.540)
IDE: VS 2017 15.3.3

Both the failing queries fail because of #16314
If it is updated like following to update the type
                context.As.Select(a => context.As.Where(a2 => a2 != null))
                          .Where(x => x.Count() == 0)
                          .Select(x => x.ToList())
                          .ToArray();

It works for both the cases correctly. It fails on Sqlite because the query requires usage of OUTER APPLY which is not supported on Sqlite.
Filing additional issues to improve patterns overall.


cr.tl.lineage_drivers is broken

cr.tl.linege_drivers is supposed to give me gene correlations with different lineages. It used to add one key per lineage to adata.var or adata.raw.var. Obviously, we expect different drivers genes for the different lineages. However, when I run it now, only a single key, gene_count_corr is added to adata.raw.var. Why is that? I would like to see the correlations of gene expression with the different sets of absorption probabilities, i.el. we need to add one key per lineage.
Versions:
cellrank==1.0.0-rc.0 scanpy==1.5.1 anndata==0.7.3 numpy==1.18.5 scipy==1.4.1 pandas==1.0.5 scikit-learn==0.22 statsmodels==0.10.2 python-igraph==0.7.1 scvelo==0.2.2.dev51+ga7de78a

...

Sorry, I just realised now that I called cr.tl.lineage_drivers, whereas in the past, I always called the corresponding estimator method. I just tried, the estimator method still works, so I guess the high level function isn't quite there yet?

Unable to reproduce, cellrank.tl.lineage_drivers just calles the estimator's lineage drivers - I've just added tests in the PR and cleaned up some error messages.

okay, maybe I made some silly mistake. I will check whether this happens again and send a MWE in that case


Python 3.7 compatibility

@conda-forge-admin, please rerender

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@jan-janssen This is noarch: python, see available versions here https://anaconda.org/conda-forge/fabric3 ... This means the package should be installable also for Python 3.7 and this PR should not be required. Any issue installing that package?

I am sorry for the confusion - bcrypt was not available for python 3.7 and as fabric depends on paramiko and paramiko depends on bcrypt I got the error message that fabric and python 3.7 were not compatible.


Cannot clone repo on Windows

I suspect that Windows files cannot contain '*' character.
PS C:\projects> git clone https://github.com/github/linguist.git
Cloning into 'linguist'...
remote: Counting objects: 32811, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 32811 (delta 4), reused 0 (delta 0), pack-reused 32798
Receiving objects: 100% (32811/32811), 33.56 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (17916/17916), done.
fatal: cannot create directory at 'samples/F': Invalid argument*
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

Whoopsie. That's gonna be due to https://github.com/github/linguist/pull/4178
/cc @pchaigno

Did we really support Windows before that #4178?
@coldner Could you try git clone --branch v6.4.1 https://github.com/github/linguist?
@lildude I'm not sure how to best address this to be honest...

FStarLing, with the "-Ling" suffix comically pertaining to LINGuist fans. ;)

I have access to a Windows 10 environment, installed by Microsoft's VagrantFile. Fee free to shoot me some instructions if you need me do help out here. 😉

What about rename directory to FStar or FStarLang?

Currently Linguist expects the directory to be named after the language. To rename the directory, we would have to dissociate directories from names and add a new key in languages.yml. This change wouldn't be too complex but it'd handle a specific case (Windows) I'm not even sure we want to support...

We have Windows users on src-d/enry, I would not be surprised if they are common on github/linguist too.

@lildude Do we want to support Windows? Should I make the necessary changes?

Do we want to support Windows?

I don't see why not as the gems should be installable. It is a bit annoying Git on Windows behaves this way, but it's also kinda weird to have a wildcard char in a directory name too.

Should I make the necessary changes?

Please do. Please also remind me that I'll need to perform the DB nudge when I make the next release once that PR has been merged so the language rename is picked up in the DB.

@coldner Could you try the fix at #4285? (Cloning the appropriate branch from my repository should do.)

I have checked that it works as expected under Windows. Closing in favor of #4285.


Facilitate conversion from CollectionFS

https://github.com/jalik/jalik-ufs/issues/14
Making the gridfs collections compatible with the structure used by CFS would be great... At least the capability to store user fields (as in metadata) and using same format for _id (obj instead of meteor string) would make it possible to point at the same gridfs collection from this package and from CFS...
Many thanks for considering.

@hluz you can store any "meta" data directly in the file collection, if you need to store userId for example, just add this attribute to the document before inserting/updating. You just have to take care of not modifying attributes used by ufs like "complete", "uploading", "url"...

Yes, I understand. It is just that cfs:gridfs also adds the metadata object to the gridfs.files, not only to the file collection...  Also using Mongo.ObjectId() for _id would be similar format to cfs:gridfs, making it easier to migrate between the two without having to do any data conversion.

@hluz I didn't have time now, will be great if you can send us a PR with your ideas.

Great idea! Has any progress been made on this thus far @hluz @jalik @rodrigok ?

@krishaamer no progress on my side since I am focusing on the main/core UploadFS package. I know this request potentially concerns a lot of users but it takes time to create a migration tool.


Importing Issue

I am importing the package by add git url but it showing error. Please Help

Hello! I've tried to install it. And it works for me. Please be sure that you put the proper git URL in the upm. It must be: https://github.com/ManakhovN/FigmaToUnityImporter.git?path=/Assets/FigmaImporter

Still not working

Still not working

Could you possibly write the exact steps that leads to this error?

Which version of unity do u use?

Unity 2021.1.7f1

Unity 2021.1.7f1

I tried it on this version and it works. I still think that you put the wrong git URL. Why it is so long on your first screen in the error? Can you write the full line that u put there? I don't see the whole link from your screen.

Instal git and reload unity and unity hub


Doubled SKU row in compare tab

Current behavior
SKU table row is doubled for all products

Expected behavior
SKU row should only be displayed once.
Steps to reproduce the issue

Open test.storefrontcloud.io
Open any category page
From category page view, add any product to compare list
Open compare window

Additional information
Appearance of this doubled row is triggered by adding product to compare from category page view. If on fresh instance we add product to compare from PDP, or from "Get inspired" homepage prouducts tiles, bug will not occur.
However, once bug is triggered, then every time we add another product to compare (now no matter in which way) - SKU row will be doubled - even if we clear wishlist in the meantime.
Can you handle fixing this bug by yourself?

[ ] YES
[x] NO

Which Release Cycle state this refers to? Info for developer.
Pick one option.

[x] This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
[ ] This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
[ ] This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

Browser: Lastest Chrome
OS: Ubuntu, Win 10
Code Version: Develop

@przspa can you please just take a look at this one?

thanks @manvendra-singh1506! :)

Bug fixed


Can you write an wiki that specify the differences between the matlab resize and pillow image.resize function(bicubic)

There are already some excellent explanations. See #15

@xinntao  thanks for your reply.I have read the explanation of the MATLAB vs OPENCV ‘s bicubic interploation.
But i do wonder the pillow python library about bicubic interpolation.
Is there any differences with the matlab?

I have not looked deep into the pillow library.
I think it is also different from the bicubic function in MatLab.
You'd better check it.


Clarify that pyxDamerauLevenshtein calculates the restricted Damerau-Levenshtein distance

There are two different distances called Damerau-Levenshtein (see the Wikipedia page, for example), one is the restricted distance and the other is the original one, the unrestricted distance. pyxDamerauLevenshtein calculates the restricted distance (so the distance between "CA" and "ABC" is 3, not 2).  It would be good for this to be made clear in the documentation.  (Even nicer would be to have a Cython implementation of the unrestricted distance as well!)
Thanks!

This is actually documented:

This implementation is based on Michael Homer's pure Python implementation, which implements the optimal string alignment distance algorithm.

Optimal string alignment (OSA) is what you call restricted damerau levenshtein distance

I'm just now getting to this, and I agree with @maxbachmann. "Optimal string alignment" and "restricted distance" are synonymous.

Ah, OK.


Implement Support for Dobutsu no Mori e+

I can't read Japanese, so I haven't gotten around to dissecting this version. I'll add it after the other games are fully supported.

As referenced in Update #2, initial support has been added.

Pretty much up to feature parity with the other versions, so I'm closing this now.


Return solution on extreme point of LP

When solution is not unique, I'm wondering is it possible to return the extreme solution of an LP? Any one is fine for me. Thanks!
(technically I can construct another LP based on the solution and solve it again over a random direction to do that, but kind of lazy...)

This is an interesting suggestion. I wouldn't make this the default, but it could be a solver option. If you use a pure LP/MILP solver like Cbc, GLPK, GUROBI, etc., you'll get an extreme point even with the current set up.