text:
Incorrect primitive_type in generated code causes "Encountered an unknown type during deserialization str"

What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Linux executable
Client library/SDK language
Python
Describe the bug
When I use the versions below of Kiota the following error occurs:
Exception: Encountered an unknown type during deserialization str
I think that the bug is due to send_collection_of_primitive_async passing argument primitive_type as str instead of <class type[str]> and located here: https://github.com/microsoft/kiota/blob/main/src/Kiota.Builder/Writers/Python/CodeMethodWriter.cs#L808
"microsoft-kiota-abstractions==1.3.3",
"microsoft-kiota-http==1.3.3",
"microsoft-kiota-serialization-json==1.3.2",
"microsoft-kiota-serialization-text==1.0.0",
"microsoft-kiota-serialization-form==0.1.1",
"microsoft-kiota-serialization-multipart==0.1.0",
Expected behavior
The get method should return a list of strings (names).
How to reproduce
Have Kiota generate a python code for an endpoint that returns a JSON collection of string (python equivalent: List[str]).
Open API description file
        "/names": {
            "get": {
                "summary": "Get names",
                "operationId": "getNames",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "uniqueItems": true,
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },

Kiota Version
1.18.0+5c6b5d0ef23865ba2f9d9f0b9fe4b944cf26b1ec
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
Manually edited the generated code and replace "str" with str.
Configuration

OS: Ubuntu

Can't see that it is specific to this configuration.
Debug output
Other information
The generated get method for the endpoint seems to be incorrect ("str" instead of str):
return await self.request_adapter.send_collection_of_primitive_async(request_info, "str", None)
Which will cause the  if generic_type in primitive_types: in JsonParseNode.get_collection_of_primitive_values  to be False
since  "str"  is NOT in primitive_types due it being an actual string (and not str, i.e. a ).
Example:
>>> types = {bool, str, int, float, bytes}
>>> type(types)
<class 'set'>
>>> str in types
True
>>> 'str' in types
False

    def get_collection_of_primitive_values(self, primitive_type: Any) -> Optional[List[T]]:
        """Gets the collection of primitive values of the node
        Returns:
            List[T]: The collection of primitive values
        """

        primitive_types = {bool, str, int, float, UUID, datetime, timedelta, date, time, bytes}

        def func(item):
            generic_type = primitive_type if primitive_type else type(item)
            current_parse_node = self._create_new_node(item)
            if generic_type in primitive_types:
                method = getattr(current_parse_node, f'get_{generic_type.__name__.lower()}_value')
                return method()
            raise Exception(f"Encountered an unknown type during deserialization {generic_type}")

        if isinstance(self._json_node, str):
            return list(map(func, json.loads(self._json_node)))
        return list(map(func, list(self._json_node)))

Hi @jimisola
Thank you for using kiota and for reaching out.
Looking at other examples your analysis seems to be correct.
Is this something you'd like to submit a pull request for provided some guidance?

authors: baywet jimisola

repo: microsoft/kiota


text:
Packet->append does increase the data region, but the packet len value stays the same.

Once we allocate a packet, we usually append some free space to be able to fit our data in the packet.
The way we are doing this is by calling packet->alloc. This, however, does not change the packet length property.
So if we call packet->length() we do not observe the new length there. Check here as an example:
https://github.com/microsoft/machnet/blob/15a937d5856dcf84139bf3db81083a206dbdd07a/src/include/machnet_engine.h#L928

Hi @sarsanaee,
Could you please elaborate on the issue?
PacketAlloc() is not meant to change the underlying mbuf size; it's merely an allocation from the pool.
The append method, is increasing the length of the packet using the underlying DPDK function.
https://github.com/microsoft/machnet/blob/15a937d5856dcf84139bf3db81083a206dbdd07a/src/include/packet.h#L132
Does this not work? Or you are pointing out that in this line:
https://github.com/microsoft/machnet/blob/15a937d5856dcf84139bf3db81083a206dbdd07a/src/include/machnet_engine.h#L929
there is no check for the return value ?

source: gharchive/issue

authors: marinosi sarsanaee

repo: microsoft/machnet

license: MIT

license_type: permissive

license_source: github-api


text:
Question: Workflow using SelectionModel with TemplateSelector

Scenario: ItemsRepeater with SelectionModel and a TemplateSelector that chooses the template based on the selected item:
protected override DataTemplate SelectTemplateCore(object item)
{
   if (item == selectionModel.SelectedItem)
   {
       return selected;
   }
   else
   {
        return normal;
   }
}

Now when we switch selection in the SelectionModel:
selectionModel.Select(SelectionModelRepeater.GetElementIndex(sender as Button));

we know the correct selection and that is all fine. However, there is no way we update the previous selection and the new selection without forcing the ItemsRepeater to rerender every item. Is there some hidden function I am missing here, or is this something currently missing in the ItemsRepeater?
Context: I found this while trying to write a sample for the XAML Controls Gallery showcasing on how to use the SelectionModel with the ItemsRepeater control.
The current source code is available here: https://github.com/chingucoding/Xaml-Controls-Gallery/tree/selectionmodel-sample
PS: To force the ItemsRepeater to really rerender everything, I had to use the following workaround since focused items with the StackLayout unfortunately don't get rerendered:
SelectionModelRepeater.ItemsSource = null;
SelectionModelRepeater.UpdateLayout();
SelectionModelRepeater.ItemsSource = staticRecipeData;
SelectionModelRepeater.UpdateLayout();

@chingucoding This is essentially the same thing #1645 is trying to solve. The way it was initially designed was to have all the realized containers hookup to the SelectionModel.SelectionChanged and re-evaluate if it was still selected when ever selection changes. We later realized that the container should probably not be doing that and instead just be told if it is selected or not. In order to do that we either need to walk all the realized containers and re-evaluate their state or add more information to the selection changed event in order to be able to find the containers that need to be updated.

That makes sense. So should I create a proposal for something to we could use to deal with this, e.g. "GetRealizedContainers" or "UpdateRealizedContainer(object item)" as there currently is no elegant way to handle this?

That makes sense. So should I create a proposal for something to we could use to deal with this, e.g. "GetRealizedContainers" or "UpdateRealizedContainer(object item)" as there currently is no elegant way to handle this?

@anawishnoff as FYI. Lets start a discussion. I think ListView exposes start and end indices of visible and realized containers, but ListView has the restriction of contiguous items. Repeater can support any custom layout, so there is no restriction on contiguousness of indices realized, so perhaps visible containers and realized containers might be more accurate. Another option is to get all realized containers and a different api to check if it is visible on screen or in the buffer area.

Does it make sense to differentiate between visible and realized containers? If the selection changes, and the previous selected item was realized but is not visible, and we scroll back to it, will it get updated? I don't think that it would be rerendered.
If we expose the realized container, would there be a way to force them to rerender themselves e.g. using UpdateLayout? If that's not the case it might make more sense to provide an API along the lines of RerenderContainerOfItem(object itemInCollection).
Something that will be problematic is the performance. After all, if an item changes in size, the layout would need to rerun its arrange step. Would we be able to keep up the scroll position with that?

We run layout on all the realized containers, so we are already doing all the work on them. The reason for having realized containers outside of the visible area is to have a buffer ready. Our scrolling is independent and layout does not get called for every tick, so if we did not have a buffer we would end seeing black (no element in that place) when you quickly scroll since the scroller is showing an area that does not have any elements laid out yet.
For this particular case, visible/released do not make any difference. We will need to update selection state on all realized containers. Ideally selection should not change the size, but if it does, then layout will run again and it should work as you expect. The anchoring feature of scroller will ensure that the element that is visible wont jump around when the sizes change.
So perhaps just getting a list of realized containers would suffice. We could later add API to differentiate if something is visible or not if desired.

@chingucoding @ranjeshj
Sorry for the delay in jumping on this thread.

This issue  also came to mind - one of the main takeways from it was that it would be good to have a FirstVisibleIndex property in an ItemsRepeater. However, as Ranjesh said above, it may not be as useful a property as it is to ListView, as ItemsRepeater doesn't require contiguous items.
A more robust solution as you two have been discussing would be a GetRealizedContainer property? I like the idea, although I am curious about performance impact.
As for re-rendering items, why couldn't you use the UpdateLayout method on each container? (Actually asking - don't know the answer!) Would this have more negative performance impact? Would it be better/possible to update the layout on only changed containers - i.e. containers that have changed their selection state?

A more robust solution as you two have been discussing would be a GetRealizedContainer property? I like the idea, although I am curious about performance impact.

Performance impact is the main problem I see with that. If we already have an existing list of realized containers, exposing it is probably not that bad. However if we have to construct that list, just for that new API, performance impact could become a very critical aspect.

As for re-rendering items, why couldn't you use the UpdateLayout method on each container? (Actually asking - don't know the answer!)

I haven't tried that, so I am not sure what would happen. Would calling UpdateLayout also switch to a different template if the TemplateSelector would "dictate" a new template for a given container/item?
Calling UpdateLayout on the Repeater itsself did not work however. Debugging it, I found out that the TemplateSelector got called for every item except the selected one (probably since it had focus).

Would this have more negative performance impact? Would it be better/possible to update the layout on only changed containers - i.e. containers that have changed their selection state?

If the layout does not run the arrange or layout phase, being able to update a single container would probably be the best case scenario. However if the size changes on those containers, we might as well ask the layout to rearrange, since we need to update the layout to prevent clipping or interlacing of items.

+1. Just exposing the list of realized containers is going to be less expensive for sure compared to exposing indices and getting callbacks trying to get container for each index. It also enables us to support non-contiguous scenarios. Getting index for a container once we have the container is not very expensive. Going from index to container is more expensive (we need to walk through all the containers looking for the one with the specified index)
Can you explain why we need to call UpdateLayout ? Ideally we should not have to explicitly do that.

If we change the SelectedItem of the SelectionModel, the ItemsRepeater has no way that it should rerender as it's not aware of the SelectionModels status. So we need to manually look out for that and update the appropriate items.

When selection changes SelectionModel will raise SelectionChanged event which the control (that is wiring up selection) needs to listen to. In the SelectionChanged handler, the control can walk through all the realized containers, get the index of each container and check if that container is selected or not in the selection model and update IsSelected on the container. Changing IsSelected should call InvalidateMeasure on the container which will take care of updating the visuals on the container and run layout if necessary.
Currently, we have to walk through all the realized containers and update IsSelected unfortunately. If SelectionChanged event gave us the subset of container indices that were removed from selection/added to selection, we can do the operation just for those specific containers (go from index to container). Given that the number of realized containers is relatively small, the initial implementation did not think this was a priority.

So the go to way to do this would creating a field IsSelected on the container? Or did I misunderstood that?
My idea was to have a template for selected/unselected. However calling update on the realized items did not change the visuals accordingly. Is the realized container even aware of the TemplateSelector? In the visual tree, it just shows the items as specified by the template.

So the go to way to do this would creating a field IsSelected on the container? Or did I misunderstood that?
My idea was to have a template for selected/unselected. However calling update on the realized items did not change the visuals accordingly. Is the realized container even aware of the TemplateSelector? In the visual tree, it just shows the items as specified by the template.

IsSelected property is one way to do it which decouples it from everything else. Lets consider an Itemcontainer control that has an IsSelected property. Setting that property to true/false can change  a visual state (Selected or not). Then the template can have the visuals to show that it is selected or not (and can be customized by re-templating).  The template selector comes in before all this to create the ItemContainer. When ItemsRepeater wants to create an element for index say 5, it will go through the template selector to create the ItemContainer. Once the container is created and put into the tree, its job is done. The template selector does not create different containers for selected vs not-selected if that is what you are asking. The same container just shows selection visuals (might be check box, or changed background or something). That is the way I would go about doing it. You might have a different idea for how to achieve something similar though.

Creating a new control for this would work, indeed. However in my opinion, creating a new control just to have different visuals for selected/not selected state seems a bit overkill.
Something I would love to do is have different templates because they are very easy to define and are not that much project overhead (new controls have to be somewhere etc). So having the a selection aware TemplateSelector would be a somewhat reasonable way, however since the TemplateSelector needs to be run again after selection changed, this gets very complicated.
While VisualStates are also an option, I haven't gotten them to work, and if you have large changes to a selected item, that can become a bit problematic and hard to read. So a separate template would in some cases just be ideal.
Now since having the realized containers also wouldn't really solve that, maybe we could provide an API to force a rerender of a container for a given item? So you could do something like this:
public OnSelectionChanged(object sender, FictiousSelectionArgs args)
{
  // Remove selection indicator from old item:
  repeater.UpdateContainerOfItem(args.DeselectedItem);

  // Update the template of newly selected item
  repeater.UpdateContainerOfItem(args.SelectedItem);
}

Currently there is GetOrCreateElement(index) however that wouldn't recreate an already existing UIObject would it? So if there is a "force create" we could enable people to rerender items without forcing a complete rerender of everything.

That is an interesting way to approach the problem. When you are saying rerender, you essentially mean throwing out the current container and creating a new one from scratch and passing the fact that you need a new container that has specific selection visuals on it. Three concerns if we go that route, (1) if we are removing and replacing the container, it is likely to create a jarring visual experience. (2) if we select all, we end up throwing out everything and replacing everything which can be bad perf wise.  (3) ScrollViewer's anchoring is tracking containers, if we completely change them out, we will end up seeing a jump in the visible portion of the screen.
Also, what would we do for drag visuals, pointer over, pressed etc, we would have to handle those on both templates now ? I agree Control is a bit heavy weight. Currently there is no prescribed ItemContainer for Repeater,  which is why it is quite a bit of work to get all this correct. We've had discussions about creating a Container that does all this or possibly helpers to help someone create their own container. For example NavigationViewItem could be using those helpers.

Essentially yes that would mean throwing away the container. That would definitely create a possible problem with flickering, agreed. If we select all items, in either way all of them need to change, and if that change would include completely changing the visual tree (because we would completely change the visuals), maybe it could actually be faster to rerender them?
The ScrollViewers anchoring is definitely a huge problem here, and there probably isn't a way to work around that except swapping the content out but live the container the same (which then again could create a jarring visual experience).

Also, what would we do for drag visuals, pointer over, pressed etc, we would have to handle those on both templates now ?

Wouldn't that already apply to any case where a TemplateSelector is used?
Maybe this is something, we could solve with an ItemContainer, like GridViewItem of GridView. That way, anchoring would still work, we could potentially work around the potential of visual glitches when switching and provide useful helpers for every item. But that would of course impact the performance significantly as we would add more items to the visual tree.

But that would of course impact the performance significantly as we would add more items to the visual tree.

That is an excellent point. Yes, if you look at the expanded template for ListViewItem, you will see how many elements it introduces into the tree. A while back we created a ListViewItemPresenter which hard coded all the visuals so that there is only one element in the tree, but of course that limits the amount of customization you can do with it. Another option to explore would be to see if we can leverage lottie here, which does something similar to expose only one element in the tree. Getting all the visual states working with lottie would be an interesting exercise.

So basically this boils down to: How much convenience should we provide compared to the performance loss that it would create in scenarios where features are unused.
Lottie would very interesting to see, though I am not sure if that be easy to implement or robust and fast enough. But I haven't worked with that at all, so no idea how that would go.
Maybe, the best advice would be: Either use VisualStates or create your own control for this.
Though that of course makes it a bit more difficult to get started with ItemsRepeater with SelectionModel. Very difficult to make the "right" decision here.

Yep. It is all possible now but takes a bunch of extra work to set it up correctly and wire it up. I can see value in doing both though. Perhaps we come up with a packaged container that does everything (with some pay for play based on features used) that is internally using some helpers that can be re-used in case one wants to put together their own solution. We can experiment along those lines and iterate until we get it right. For some scenarios the bit of performance loss might be acceptable compared to the ease of creating something that works out of the box quickly.

That would also be a very good idea. However what is the benefit compared to an already existing control e.g. Button or ContentControl which already supports a lot of cases?
Maybe this is something that the Windows Community Toolkit could help out with? (@michael-hawker FYI)
That way, there is an easy way to get started but if people want to get the best performance they can do it now. Should we create a separate issue to further discuss what should and can be covered by such an control?

Another option might be to think of these as attachable behaviors to any control that is the root of the template. I have not thought through all the details if we went that route to be frank. But that might avoid the necessity to create a control.

That would also be a suitable path to use, and that could be easier to use for developers.
@anawishnoff What are your thoughts on this?

@chingucoding @ranjeshj
I like the idea of having a flexible container that can hold items and handle selection without the above mentioned setbacks (removing entire container, flickering, etc) that can also be reusable to other collection type controls if developers want to implement their own selection visual template as was one of the original point of this proposal (I believe). Although, creating something new like this would be a heavy duty project and would take much longer to implement.
I'd like to hear more about creating these attachable behaviors. I'm a little fuzzy on exactly what role they'd play. What would a behavior be? It would be the root element of an item template?

I've tried to implement parts of those two scenarios (container that handles everything and attached behaviors) in a test project: https://github.com/chingucoding/ItemsRepeaterExperiments
I think there is a problem which we can't get around: We need a Control to enable using VisualStates and VisualStates are a bit fragile. Here a rundown of issues/problems for both proposed solutions:
Container
Having a container that we wrap around each item similiar to ListView has some benefits:

We always have a Control on which we can use to provide VisualStates
We can provide events for most scenarios, e.g. "Click" or "Selection".
Can be incorporated into the control or optin

However a container has some drawbacks:

If the user uses a Control as root element of the DataTemplate, the container won't be able to provide VisualStates
Placing the VisualStates in the wrong place easily breaks them
We pollute the visual tree unnecessarily
If we would provide a way to force a rerender of an item, we still can get flickering and layout issues

Attached behavior
Attached behaviors have one big benefit: They are not costing performance if unused. However they also have their issues:

Users MUST use a Control
How do we keep track of items? Creating a list/dictionary could potentially cost a lot of resources. Should they be "fire and forget" as used in my sample project?
Still initial setup cost
Would definitely have issues with template selectors

So there seems to be no good solution to the workflow with TemplateSelectors that need to switch after initial setup?
Maybe we could provide a allround container that people can use in their template (as done in my sample project), but that is not necessary to use? Making it the root UIElement of the DataTemplate seems reasonable to do, and if somebody is concerned with the performance, they can implement only what they need themselves.
Also currently there are some scenarios which should be easier e.g. getting the ItemsSource item from a given UIElement. Those are also mentioned in the sample project with the "@WINUI" keyword in the comments of the functions.

Thanks so much for setting up this prototype and doing this research @chingucoding! This is really detailed and helpful. I've been playing around with the prototype and I have a few clarifying questions from your comment:

Container
Having a container that we wrap around each item similiar to ListView has some benefits:

We always have a Control on which we can use to provide VisualStates
We can provide events for most scenarios, e.g. "Click" or "Selection".
Can be incorporated into the control or optin

However a container has some drawbacks:

> * If the user uses a Control as root element of the DataTemplate, the container won't be able to provide VisualStates

Placing the VisualStates in the wrong place easily breaks them
We pollute the visual tree unnecessarily
> * If we would provide a way to force a rerender of an item, we still can get flickering and layout issues

When you say uses a Control as the root element do you mean uses a custom control instead of i.e. a StackPanel? Is this because custom controls don't enable VisualStates or something like that?
Why would we need to force re-render of an item if using these containers? Are there certain scenarios that can't be expressed using visual states? Or is this an issue solely for the TemplateSelector changing the appearance after an event?
As for the attached behaviors stuff:
This method seems cleaner than the other method, although in that regard I could see it having more corner cases be easier to miss specific functionality...

How do we keep track of items? Creating a list/dictionary could potentially cost a lot of resources. Should they be "fire and forget" as used in my sample project?

By this do you mean keeping track of selected and deselected items? That goes back to the other issue we have open about this (#2247). Would something like that solve this issue?
I'm not sure which is the better solution but the container seems more all-inclusive. Thanks again for setting all this up!

When you say uses a Control as the root element do you mean uses a custom control instead of i.e. a StackPanel? Is this because custom controls don't enable VisualStates or something like that?

With Control I was referring to the type Control Class which is not inherited by a lot of classes that are commonly used as layout roots for templates.

Why would we need to force re-render of an item if using these containers? Are there certain scenarios that can't be expressed using visual states? Or is this an issue solely for the TemplateSelector changing the appearance after an event?

That is solely an issue for the TemplateSelector issue. Something that we could do to circumvent this is to just say that it is not recommended. For other scenarios we don't need a rerender.

How do we keep track of items? Creating a list/dictionary could potentially cost a lot of resources. Should they be "fire and forget" as used in my sample project?

By this do you mean keeping track of selected and deselected items? That goes back to the other issue we have open about this (#2247). Would something like that solve this issue?

I was thinking more about the pattern on how to use the attached behaviors. In the sample project, we create the wrapper for those attached behaviors every time we need some functionality of them. But that seems like a bad idea, instead it would be easier to just create the attached behavior for the items, and then simply be able to reference that, similiar to the container which you can access all the time.
For example, if we would introduce an IsSelected flag on an attached behavior and use the fire and forget pattern, that flag would actually be useless as the object that store's the flag gets thrown away. Hope that makes sense.
So both methods have it's advantages and disadvantages. Maybe this is something where we just provide some helpers but not a built in solution that people can use to get started easier with the ItemsRepeater or we leave the helpers for that up to the Windows Community Toolkit.

@chingucoding yeah, this seems like there's potential for using the Behaviors library to help hook this all together more easily. We have helpers in the Toolkit around this and a few Behaviors already.
Though I'm not sure how that'd play with the Visual State/Control stuff, not sure if I fully grasp that part of the issue you were facing yet, or if we'd just want to expose a dependency property for selection to let the developer do what they wish (i.e. just bind with a converter for a border or something)?

The general question is: What would be the easiest for ItemsRepeater users without them having to start from scratch. Having a DP for IsSelected could also work in some cases, but maybe in other cases having a VisualState is better, especially when there are many things one wants to change for selected items.

@chingucoding, Thank you for creating the prototype. Can you please add this to a prototype folder and create a PR ? We can use the PR to annotate and improve the prototype and discuss options through the PR.
Some notes regarding the prototype

HandleContainer case

HandleContainer being a control, can have the visual states in its template, so you dont have to specific them inline in the ItemTemplate (for all the states). The ItemTemplate would contain only

Behavior case

The Behavior needs to be an attachable behavior. You can use attached properties for that. You don't have to set it up in ElementPrepared. Instead when the behavior is attached, you can run that code. So something like this..

...visual states ...
</>

I have not answered many of your questions :). Lets start a PR and I can try to answer them as we go.

Do you want me to create the PR to a new prototype folder inside the WinUI repo?

HandleContainer case

HandleContainer being a control, can have the visual states in its template, so you dont have to specific them inline in the ItemTemplate (for all the states). The ItemTemplate would contain only

My idea was that we just switch visual states and the end user can decide what action to take upon visual state switch, otherwise ItemsRepeater is just becoming a GridView with different layouts.

Behavior case

The Behavior needs to be an attachable behavior. You can use attached properties for that. You don't have to set it up in ElementPrepared. Instead when the behavior is attached, you can run that code. So something like this..

I've talked with @michael-hawker about this yesterday. Since he wanted to explore this too, what would be the best thing to do now?
@michael-hawker FYI.

Do you want me to create the PR to a new prototype folder inside the WinUI repo?
Yes. Please create a PR to a new feature branch named (feature\ItemContainerPrototype). The PR is just a way to comment on different parts of the code.

My idea was that we just switch visual states and the end user can decide what action to take upon visual state switch, otherwise ItemsRepeater is just becoming a GridView with different layouts.

Yes. This option takes us closer to how ListViewItem works. You can still change what happens in the visual states by providing a style for the HandleContainer. One advantage I see with this option is ease of use since we can provide a default style/template similar to ListViewItem.

Yes. Please create a PR to a new feature branch named (feature\ItemContainerPrototype). The PR is just a way to comment on different parts of the code.

There currently is no branch "feature\ItemContainerPrototype" and since I do not have write access to the repository, I can't create it. Do you want me to create the PR just inside my fork or towards master branch of this repo?

Yes. This option takes us closer to how ListViewItem works. You can still change what happens in the visual states by providing a style for the HandleContainer. One advantage I see with this option is ease of use since we can provide a default style/template similar to ListViewItem.

Is that the direction we want to go? Currently almost any aspect of ItemsRepeater is more like "choose what you want, nothing preconfigured" and providing a Container that has all states and styles already defined seems a different direction than what we did on previous parts of the repeater. That you essentially need to create a new style for the container to change the visuals seems a bit off here, but that's just my opinion here.

There currently is no branch "feature\ItemContainerPrototype" and since I do not have write access to the repository, I can't create it. Do you want me to create the PR just inside my fork or towards master branch of this repo?

Yes. against master should be fine as well.

Is that the direction we want to go? Currently almost any aspect of ItemsRepeater is more like "choose what you want, nothing preconfigured" and providing a Container that has all states and styles already defined seems a different direction than what we did on previous parts of the repeater. That you essentially need to create a new style for the container to change the visuals seems a bit off here, but that's just my opinion here.

Making it easier to consume would involve providing some defaults. If there is a way to completely replace the visuals, then it is probably ok.  I agree that the default container would have a lot more than what one would need (similar to ListViewItem), but it could be a quick way to provide behavior/visuals that matches the current ListView for someone who does not want to take the time to write it all. Note that this is still decoupled, so we do not require the usage of this container with Repeater. The style can include only the pieces you need (reducing the element tree). Essentially what you provided inline in your example in the ItemTemplate would be in the style. At this point, I'm just trying to explore the options more to see what issues we might hit down the line.

Making it easier to consume would involve providing some defaults. If there is a way to completely replace the visuals, then it is probably ok. I agree that the default container would have a lot more than what one would need (similar to ListViewItem), but it could be a quick way to provide behavior/visuals that matches the current ListView for someone who does not want to take the time to write it all. Note that this is still decoupled, so we do not require the usage of this container with Repeater. The style can include only the pieces you need (reducing the element tree). Essentially what you provided inline in your example in the ItemTemplate would be in the style. At this point, I'm just trying to explore the options more to see what issues we might hit down the line.

I see, yes that makes sense. Created #2284 now with updated handle container.

authors: anawishnoff chingucoding michael-hawker ranjeshj

repo: microsoft/microsoft-ui-xaml


text:
Question: [Is there any way to make Winui# applocation Top on all other application on windows even it should come Top on Start Menu windows ]

Hi
I am creating a overlay using OverlappedPresenter
iIm making overlay top on all application i have achived this but it not coming top on Windows start Menu is there any way to do it By using Winui3

any reply @pratikone @mrlacey @joelleigh @Marv51 @

The start menu is using private OS functionality that allows it to present on top of every other window. You can't go over it. What are you trying to achieve?

I'm trying achieve my winui3 overlay come too on all other applications and
on game window we achived it by using WPF by giving UiAccess=true flag ain
appmanifest but in winui3 we can not able to do that so we are searching
other way to make it too always
On Tue, 30 Nov, 2021, 8:56 pm Charles Milette, @.***>
wrote:

The start menu is using private OS functionality that allows it to present
on top of every other window. You can't go over it. What are you trying to
achieve?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/microsoft-ui-xaml/issues/6361#issuecomment-982742855,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AWRMZ3PAWZDWETESQOBFI3LUOTUK3ANCNFSM5IQHAGXQ
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

authors: Sacwith sylveon


text:
Bug: Second item in sub menu is selected first when using arrow key navigationBug title

Describe the bug
for Windows Explorer: file > context button or right-click > Open with (has focus) > right-cursor > submenu is displayed but nothing has focus...
but to give keyboard focus to the 1st item in the list I now have to press cursor-down (2nd item is selected), cursor-up (1st item is selected)
in other words it takes 1 less key to select the 2nd item than the 1st
I haven't discovered any other way from the keyboard to more efficiently select the 1st item in the sub-menu
Steps to reproduce the bug

select file/ thumbnail
context button or right-click
Open with (has focus)
right-cursor
submenu is displayed but nothing has focus

Expected behavior
maybe give 1st item in the sub-menu focus when right-cursor is pressed?
Screenshots
No response
NuGet package version
None
Windows version
Windows 11 (21H2): Build 22000
Additional context
No response

Video recorded
https://github.com/files-community/Files/assets/62196528/f4ac0be4-f3fe-468f-b3c9-14e9ded5544f

The item is focused but it does not seem to be drawing the focus rect.

@ranjeshj I'm pretty sure it's not focused because in that case, pressing the enter key would trigger the item.


text:
Update CommandBarFlyout close and open animations.

I've updated the CommandBarFlyout's close and open animations to be an 83ms opacity animation, instead of the previous clip animation.

/azp run

/azp run

/azp run

/azp run

I've updated the CommandBarFlyout's close and open animations to be an 83ms opacity animation, instead of the previous clip animation.

So no more slick and smooth resizing (grow and shrinking), we are just going to fade in and out of view now?
EDIT: Or are we fading out the shadow before resizing the CommandBarFlyout?

Checked the latest commit, and the main entrance animation is now a fade.
Whilst I understand it was felt this change was needed, it is unfortunate.  But now it begs the question, what about the Menu Flyouts, these still have a slide and resize animation.  Do these change too, or is CommandBarFlyout a special case that needed dealing with?
Also what about the entrance animations for CalendarView Flyout, Date and Time picker flyouts?

source: gharchive/pull-request

authors: StephenLPeters mdtauk


text:
Update ScrollBar thumb template to use ThemeResource instead of StaticResource

This Resource isn't overrideable in its current state and this change allows terminal to change the width of their scrollbars https://github.com/microsoft/terminal/issues/9218

/azp run

/azp run

/azp run

/azp run

/azp run

/azp run

authors: StephenLPeters bpulliam ojhad


text:
MIMALLOC_RESERVE_HUGE_OS_PAGES has no effect

The reason is very simple: the value is checked in mi_process_init, however, the options are processed later in mi_process_load.

Here is the relevant sequence of events: I'm having mimalloc linked statically with libgomp linked in as a shared library. It looks like libgomp does memory allocation during the load (because is uses sysconf to query for number of CPUs). As a result, mi_thread_init is called before mimalloc's static ctor (and the order of ctors is undefined) that calls mi_process_load and processes the options....

So, maybe the handling of huge pages should be moved to mi_process_load?

mmm, I am not sure this is correct. When an option is checked for the first time it is UNINIT and will call options.c:mi_option_init which will get it from the environment. So it should read it correctly.
At some point, all options are initialized (in options.c:_mi_options_init) but this just reads every one of them -- already initialized ones are left alone; this _mi_options_init is then mostly just to display all the options that are set in verbose mode. Can you try running with MIMALLOC_VERBOSE=1?

Some other causes might be, misspelled environment? wrong permissions (see here ) although MIMALLOC_VERBOSE should  show a warning in those cases.

Nope :)
Here we go:
mimalloc: process init: 0x7f2af775b1c0                                                                                mimalloc: secure level: 0                                                                                mimalloc: using 4 numa regions
mimalloc: option 'show_errors': 1
mimalloc: option 'show_stats': 0                                                                                mimalloc: option 'eager_commit': 1
mimalloc: option 'eager_region_commit': 1
mimalloc: option 'reset_decommits': 0
mimalloc: option 'large_os_pages': 0
mimalloc: option 'reserve_huge_os_pages': 10
mimalloc: option 'segment_cache': 0
mimalloc: option 'page_reset': 1
mimalloc: option 'abandoned_page_reset': 0
mimalloc: option 'segment_reset': 0                                                                                mimalloc: option 'eager_commit_delay': 1
mimalloc: option 'reset_delay': 100
mimalloc: option 'use_numa_nodes': 0
mimalloc: option 'os_tag': 100
mimalloc: option 'max_errors': -1

And yes, I certainly double checked that:

mi_process_init is called before mi_process_load
mi_option_is_enabled(mi_option_reserve_huge_os_pages) returns false inside mi_process_init

So, the options are not initialized due to this:
  #ifndef _WIN32
  // cannot call getenv() when still initializing the C runtime.
  if (_mi_preloading()) return;
  #endif

Ah right: the offending code is:
#ifndef _WIN32
  // cannot call getenv() when still initializing the C runtime.
  if (_mi_preloading()) return;
  #endif

in options.c. Tricksy..   I have been thinking about changing this. Already on Windows mimalloc uses GetEnvironmentVariableA so it can read the environment even before the CRT is loaded. On Linux we could use

well, maybe ensure that no options are used during the initialization? And perform kind of two-step init?

I considered that but some options are difficult to delay initialization on. Like use_numa_nodes, or eager_commit. So, the options are now robust against reading "too early" but may return default values while the C runtime is still loading. I think it is better to just make reading the environment possible even before the CRT is loaded.

For now, I could try to comment out the #ifdef and see if it happens to work? :-)

Pushed a possible fix; let me know how it goes.

So, just removing the ifdef worked, but I guess because I had libc.so loaded by dynamic linker first. Not sure how it'd work if libc would be loaded statically or on some other implementations (e.g. musl or Apple's libc :))

Thanks. Did the latest dev fix the issue as well?

@daanx apparently the issue remained in the latest dev, I see the same "warning error" as well

Hi @the-oaks, that is strange -- it should work now. Can you provide more information: What platform are you using? What was the environment variable that didn't work? Can you run with MIMALLOC_VERBOSE so we can see what was read from the environment. (Do have more than 256 environment variables?).   Thanks!

authors: asl daanx the-oaks

repo: microsoft/mimalloc


text:
Error "ResizeObserver loop completed with undelivered notifications" with automaticLayout option

Reproducible in vscode.dev or in VS Code Desktop?

[X] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

[X] Not reproducible in the monaco editor playground

Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
Reproduction Steps

git clone https://github.com/kfrederix/monaco-resizeobserver-error.git
npm i
npm run dev
open the page in chrome
open the dev tools (and make sure they are docked to the bottom)
drag the dev tools up and down (to force the re-layout)

Following above steps will result in below error:

Actual (Problematic) Behavior
The ResizeObserver code (which lives in vscode repo) produces an error "ResizeObserver loop completed with undelivered notifications" when option automaticLayout is enabled. This error becomes visible when using webpack dev-server.
Expected Behavior
No ResizeObserver error when using webpack dev-server.
Additional Context
This bug is a duplicate of: https://github.com/microsoft/vscode/issues/183324
But I'm re-creating it here, since the one on vscode repo got closed while the issue is not yet fixed.
(+ also duplicated by https://github.com/microsoft/vscode/issues/197629)

I beelive the issue is linked to webpack devserver. Its a major pain point for me too

@simonh1000 yes with webpack dev-server it becomes visible from that overlay, as shown in the screenshot. (Without webpack dev-server the error is also there but it doesn't get in your way (so it's less of an issue...)

This could even be a bug in the webpack devserver. Please provide a monaco editor playground example so that we can reproduce and debug this issue.

This is not related to the devserver. With the reproduction above, the error becomes always visible by installing an explicit handler on window.onerror, irrespective of the devserver:
window.onerror = console.log

How can we get this reopened - this is a catastrophic that the issue is dismissed

I am able to reproduce it also on the playground now. I will open a new issue with playground repo so it can not be ignored anymore.

FYI: re-opened, including playground repro case: #4311

authors: hediet lucach marigold-kfrederix simonh1000

repo: microsoft/monaco-editor


text:
Run-AlValidation fails when -InstallApps is used

Run-AlValidation fails on removing a temp folder when -InstallApps is used.
I found with my real world apps, but recreated it with a simple setup using two "Hello World" apps. This will of course fail later in the process, but just to make repro simple.
Scripts used to create container and cause the issue
Run-AlValidation `
    -licenseFile $licenseFile `
    -apps @("E:\Temp\Hello2\Default publisher_Hello2_1.0.0.0.app") `
    -affixes @("TEST") `
    -countries @("gb", "dk") `
    -installApps @("E:\Temp\Hello1\Default publisher_Hello1_1.0.0.0.app")

Full output of scripts
BCContainerHelper is version 1.0.19
BCContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 20H2
Docker Client Version is 20.10.0
Docker Server Version is 20.10.0
PS C:\WINDOWS\system32> E:\Temp\AppValidTest.ps1
BcContainerHelper version 1.0.19
  _____                               _
 |  __ \                             | |
 | |__) |_ _ _ __ __ _ _ __ ___   ___| |_ ___ _ __ ___
 |  ___/ _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__/ __|
 | |  | (_| | | | (_| | | | | | |  __/ |_  __/ |  \__ \
 |_|   \__,_|_|  \__,_|_| |_| |_|\___|\__\___|_|  |___/

Container name               bcserver
Image name
Credential                   admin/Zanu6693
License file                 Specified
MemoryLimit                  8G
validateVersion
validateCurrent              False
validateNextMinor            False
validateNextMajor            False
SasToken                     Not Specified
countries                    gb,dk
validateCountries            gb,dk
affixes                      TEST
supportedCountries
vsixFile
Install Apps
- E:\Temp\Hello1\Default publisher_Hello1_1.0.0.0.app
Previous Apps
- None
Apps
- E:\Temp\Hello2\Default publisher_Hello2_1.0.0.0.app
  _____       _                      _                         _   _  __           _
 |  __ \     | |                    (_)                       | | (_)/ _|         | |
 | |  | | ___| |_ ___ _ __ _ __ ___  _ _ __   ___    __ _ _ __| |_ _| |_ __ _  ___| |_ ___
 | |  | |/ _ \ __/ _ \ '__| '_ ` _ \| | '_ \ / _ \  / _` | '__| __| |  _/ _` |/ __| __/ __|
 | |__| |  __/ |_  __/ |  | | | | | | | | | |  __/ | (_| | |  | |_| | || (_| | (__| |_\__ \
 |_____/ \___|\__\___|_|  |_| |_| |_|_|_| |_|\___|  \__,_|_|   \__|_|_| \__,_|\___|\__|___/

Found https://bcartifacts.azureedge.net/sandbox/17.2.19367.20615/gb
Found https://bcartifacts.azureedge.net/sandbox/17.2.19367.20615/dk
Using https://bcartifacts.azureedge.net/sandbox/17.2.19367.20615/gb
  _____       _                      _       _                   _                           _
 |  __ \     | |                    (_)     (_)                 | |                         | |
 | |  | | ___| |_ ___ _ __ _ __ ___  _ _ __  _ _ __   __ _    __| | ___ _ __   ___ _ __   __| | ___ _ __   ___ _   _
 | |  | |/ _ \ __/ _ \ '__| '_ ` _ \| | '_ \| | '_ \ / _` |  / _` |/ _ \ '_ \ / _ \ '_ \ / _` |/ _ \ '_ \ / __| | | |
 | |__| |  __/ |_  __/ |  | | | | | | | | | | | | | | (_| | | (_| |  __/ |_) |  __/ | | | (_| |  __/ | | | (__| |_| |
 |_____/ \___|\__\___|_|  |_| |_| |_|_|_| |_|_|_| |_|\__, |  \__,_|\___| .__/ \___|_| |_|\__,_|\___|_| |_|\___|\__, |
                                                      __/ |            | |                                      __/ |
                                                     |___/             |_|                                     |___/
Remove-Item : Cannot find path 'C:\Users\AskeHolst\AppData\Local\Temp\b63dd82d-bd60-4133-b0d2-18df18c8a5d2' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\1.0.19\AppHandling\Run-AlValidation.ps1:190 char:9
+         Remove-Item $tmpFolder -Recurse -Force
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\AskeHo...d2-18df18c8a5d2:String) [Remove-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

...

Additional context
Sample apps used in this test are attached.
HelloApps.zip

I think this is fixed in the latest preview (1.0.20 -preview)

I think this is fixed in the latest preview (1.0.20 -preview)

Indeed it is - just tested this.

Indeed it is - just tested this.

Shipped in BcContainerHelper 2.0.0

Shipped in BcContainerHelper 2.0.0

authors: AskeHolst freddydk

repo: microsoft/navcontainerhelper


text:
Hlu/summarization evaluation

Description

Related Issues

Checklist:

[x] My code follows the code style of this project, as detailed in our contribution guidelines.
[x] I have added tests.
[x] I have updated the documentation accordingly.

@daden-ms I've addressed all comments so far. Let me know if you have any additional comments on the changes.

@daden-ms I've addressed all comments so far. Let me know if you have any additional comments on the changes.

There is discrepancy between what you handle the rouge_ext and compute_rouge_python. Let's discuss the change for Rouge_ext offline.

@daden-ms I've addressed all comments so far. Let me know if you have any additional comments on the changes.

There is discrepancy between what you handle the rouge_ext and compute_rouge_python. Let's discuss the change for Rouge_ext offline.

Made the changes we discussed. Let me know if missed anything.

authors: daden-ms hlums

repo: microsoft/nlp-recipes


text:
利用multi-trial进行EfficientNET的nas测试似乎没有正常运行，代码运行处于停滞状态，为什么呢？

A.测试环境：
Ubuntu18，15.5 GiB，Intel® Core™ i7-10700 CPU @ 2.90GHz × 16 ，
GeForce RTX 2080/PCIe/SSE2;
python3.7 pytorch1.7
测试内容：利用multi-trial进行EfficientNET的nas
B.参考代码来源：
1.搜索算法相关：～/nni-master/examples/trials/efficientnet
2.EfficientNet基本网络以及训练脚本：
git clone https://github.com/ultmaster/EfficientNet-PyTorch
参考来源：～/nni-master/docs/zh_CN/TrialExample/EfficientNet.rst
C.实际使用方法：
nnictl create --config config.yml  --foreground
其中：config.yml（参考B.1）
searchSpaceFile: search_net.json
trialCodeDirectory: EfficientNet-PyTorch
trialCommand: python3 main.py /home/jsx/data/public_data/mini-imagenet/mini-imagenet-ok -j 12 -a efficientnet --batch-size 12 --lr 0.048 --wd 1e-5 --epochs 5 --request-from-nni
trialGpuNumber: 1
trialConcurrency: 3
maxTrialNumber: 100
tuner:
className: tuner.FixedProductTuner
codeDirectory: .
classArgs:
product: 2
trainingService:
platform: local
useActiveGpu: false
search_net.json（参考B.1）
{
"alpha": {
"_type": "quniform",
"_value": [1.0, 2.0, 0.05]
},
"beta": {
"_type": "quniform",
"_value": [1.0, 1.5, 0.05]
},
"gamma": {
"_type": "quniform",
"_value": [1.0, 1.5, 0.05]
}
}
D.使用中出现问题：代码运行后没有进行正常运算，似乎在停滞状态？终端打印没有任何响应或log打印信息，但其实在EfficientNet训练代码中是有log显示的，这似乎不正常，如何调试判断目前什么状况。具体显示：
INFO:  Starting restful server...
INFO:  Successfully started Restful server!
INFO:  Starting experiment...
INFO:  Successfully started experiment!
The experiment id is exl9ST75
The Web UI urls are: http://127.0.0.1:8080 http://10.100.34.215:8080
You can use these commands to get more information about the experiment
     commands                       description

nnictl experiment show        show the information of experiments
nnictl trial ls               list all of trial jobs
nnictl top                    monitor the status of running experiments
nnictl log stderr             show stderr log content
nnictl log stdout             show stdout log content
nnictl stop                   stop an experiment
nnictl trial kill             kill a trial job by id
nnictl --help                 get help information about nnictl

Command reference document https://nni.readthedocs.io/en/latest/Tutorial/Nnictl.html
[2021-12-10 11:03:39] INFO (NNIDataStore) Datastore initialization done
[2021-12-10 11:03:39] INFO (RestServer) RestServer start
[2021-12-10 11:03:39] INFO (RestServer) RestServer base port is 8080
[2021-12-10 11:03:39] INFO (main) Rest server listening on: http://0.0.0.0:8080
[2021-12-10 11:03:40] INFO (NNIManager) Starting experiment: exl9ST75
[2021-12-10 11:03:40] INFO (NNIManager) Setup training service...
[2021-12-10 11:03:40] INFO (LocalTrainingService) Construct local machine training service.
[2021-12-10 11:03:40] INFO (NNIManager) Setup tuner...
[2021-12-10 11:03:40] INFO (NNIManager) Change NNIManager status from: INITIALIZED to: RUNNING
[2021-12-10 11:03:40] INFO (NNIManager) Add event listeners
[2021-12-10 11:03:40] INFO (LocalTrainingService) Run local machine training service.
[2021-12-10 11:03:41] INFO (NNIManager) NNIManager received command from dispatcher: ID,
[2021-12-10 11:03:41] INFO (NNIManager) NNIManager received command from dispatcher: TR, {"parameter_id": 0, "parameter_source": "algorithm", "parameters": {"gamma": 1.4000000000000001, "beta": 1.0, "alpha": 1.0}, "parameter_index": 0}
[2021-12-10 11:03:41] INFO (NNIManager) NNIManager received command from dispatcher: TR, {"parameter_id": 1, "parameter_source": "algorithm", "parameters": {"gamma": 1.35, "beta": 1.05, "alpha": 1.0}, "parameter_index": 0}
[2021-12-10 11:03:41] INFO (NNIManager) NNIManager received command from dispatcher: TR, {"parameter_id": 2, "parameter_source": "algorithm", "parameters": {"gamma": 1.3, "beta": 1.1, "alpha": 1.0}, "parameter_index": 0}
[2021-12-10 11:03:45] INFO (NNIManager) submitTrialJob: form: {
sequenceId: 0,
hyperParameters: {
value: '{"parameter_id": 0, "parameter_source": "algorithm", "parameters": {"gamma": 1.4000000000000001, "beta": 1.0, "alpha": 1.0}, "parameter_index": 0}',
index: 0
},
placementConstraint: { type: 'None', gpus: [] }
}
[2021-12-10 11:03:45] INFO (NNIManager) submitTrialJob: form: {
sequenceId: 1,
hyperParameters: {
value: '{"parameter_id": 1, "parameter_source": "algorithm", "parameters": {"gamma": 1.35, "beta": 1.05, "alpha": 1.0}, "parameter_index": 0}',
index: 0
},
placementConstraint: { type: 'None', gpus: [] }
}
[2021-12-10 11:03:45] INFO (NNIManager) submitTrialJob: form: {
sequenceId: 2,
hyperParameters: {
value: '{"parameter_id": 2, "parameter_source": "algorithm", "parameters": {"gamma": 1.3, "beta": 1.1, "alpha": 1.0}, "parameter_index": 0}',
index: 0
},
placementConstraint: { type: 'None', gpus: [] }
}
(在此发生停滞，无任何输出 Stagnation occurs with no output)
E.尝试测试：在安装路径下的nni库进行调试，发现～/nni-master/nni/tools/nnictl/launcher.py下运行到
def launch_experiment（）函数的如下部分便不再打印任何信息,似乎进入死循环状态：
if mode != 'view' and args.foreground:
try:
while True:
log_content = rest_process.stdout.readline().strip().decode('utf-8')
而rest_process不理解这个运行机理，所以目前产生的问题无法定位解决，希望给给予帮助解释。

你看过 WebUI 上有什么信息吗？trial 几个成功几个失败了？trial 的 log 里内容是什么？

你看过 WebUI 上有什么信息吗？trial 几个成功几个失败了？trial 的 log 里内容是什么？

WebUI上就是正常显示空，但没有计算结果；所以采用前台处理模式想查看到底在做什么
trial测试都是这种状态，没有下一步运行结果
trial log都是空的，除了标准的头标记，没有其他结果；nnimanager.log结果与终端打印一致，--debug模式会不断输出 DEBUG(IcpInterface) icpInterface command type:[PI], content:[]
难道我应该等很久才会开始计算出结果吗？但第一次尝试时（不是这个测试用例，但基本使用方法一样），运行一天一晚上输出评估结果都是平的，没有变化，但时间很久了记得不是非常清楚就是记得与说明中不一致不正常。 目前最主要问题是，我应该如何进行下一步测试，来验证是否是我使用的问题？

WebUI上就是正常显示空

是什么意思。正常显示应该不是空。

trial 几个成功几个失败了？

这个能看一下吗？Details 页面应该有一系列 trial 的记录，点进去可以看到 stderr 和 stdout。都是空的吗？

根据对比测试，是配置文件的gpu相关参数以及本身efficientnet代码中bug，修改后虽有失败情况但可以正常运行训练

authors: jsxapril ultmaster

repo: microsoft/nni


text:
update issue bug report template

add Describe the bug at the issue beginning, in this item, could summary the question and upload related image bug message

bold NNI version nnimanager.log | dispatcher.log | nnictl stdout and stderr

How to reproduce it? : some people will write something in this plate, and it's beneficial to us so I don't want to delete it.

I recently found experiment config very useful.
I suggest update the template like follow.
**Describe the issue**:

**Environment**:
- NNI version:
- Training service (local/remote/aml/etc):
- Client OS:
- Server OS (for remote mode only):
- Python version:
- PyTorch/TensorFlow version:
- Is conda/virtualenv/venv used?:
- Is running in Docker?:

**Configuration**:
Experiment config: (remember to remove secrets!)
Search space:

**Log message**:
nnimanager.log:
dispatcher.log:
nnictl stdout and stderr:

<!--
Where can you find the log files:
LOG: https://github.com/microsoft/nni/blob/master/docs/en_US/Tutorial/HowToDebug.md#experiment-root-director
STDOUT/STDERR: https://github.com/microsoft/nni/blob/master/docs/en_US/Tutorial/Nnictl.md#nnictl%20log%20stdout
-->

**How to reproduce it?**:

authors: Lijiaoa liuzhe-lz


text:
Refactor optimizer/evaluator.py and visitor.py to not use _legacy_ir

Optimizer relies on graph analysis to fold constant.
https://github.com/microsoft/onnxscript/blob/2824bc8c00af90f9371fd8080d84ef469bb8b4f0/onnxscript/optimizer/evaluator.py#L52
We should either extend the current IR to analyze graph, or develop/keep IRContext, but detach it with StaticValueInfo in _legacy_ir folder.
Lack of: StaticValueInfo.symbolic_value
https://github.com/microsoft/onnxscript/blob/2824bc8c00af90f9371fd8080d84ef469bb8b4f0/onnxscript/_legacy_ir/__init__.py#L61-L66
The usages:
https://github.com/microsoft/onnxscript/blob/2824bc8c00af90f9371fd8080d84ef469bb8b4f0/onnxscript/optimizer/constant_folding.py#L152-L171
cc @gramalingam @justinchuby

Related #1324

https://github.com/microsoft/onnxscript/issues/1438

[IR] Support symbolic values? #1438

Related

Do we want to create something similar to the interpreter in fx as a simplified visitor for general use?

Do we want to create something similar to the interpreter in fx as a simplified visitor for general use?

We can discuss offline if you have an idea.
For this issue, do you think IRContext is something that we can merge into IR after having symbolic_value? Looks like visitor.py also needs a huge refactor..

authors: justinchuby titaiwangms

repo: microsoft/onnxscript


text:
Hack に取り掛かる際のノートブックの入手方法のガイド

Repos と DBC ファイルのインポートのやり方がある
2023 年 4 月開催分を見ていると、チーム メンバー全員が Repo をクローンするチームが多かった
対応
PowerPoint 資料の方に以下方針を反映する

dbc ファイルをインポートしてチーム共通のノートブックとして利用する
各人が手元で変更するように Repos でクローンする（config を自身の名前に変更する) ようガイドする

こちら対応済み。クローズ。


text:
[Question]: is playwright.ps1 install needed if we have <PlaywrightPlatform>?

Your question
Question:
Do I need to run playwright.ps1 install if I have this in my csproj?
<PropertyGroup>
  <PlaywrightPlatform>linux</PlaywrightPlatform>
</PropertyGroup>

I do a dotnet publish.
If not, then what's the benefit of <PlaywrightPlatform>?
(related: #2098, #2086)

Here is how I currently think Playwright works:
  flowchart TD
      subgraph language [Language Process]
      .NET
      Java
      Python
      end

      subgraph nodeprocess [Node.js Process]
      driver[Playwright Driver]
      linux -.- driver
      osx -.- driver
      win -.- driver
      end

      subgraph browserprocess [Browser Process]
      Chromium
      Firefox
      WebKit
      others[Chrome / Edge / others via WS / CDP]
      end

      language-- Playwright Protocol ---nodeprocess
      nodeprocess-- DevTools Protocol ----browserprocess

      style others stroke-dasharray: 5 5

Playwright Protocol: https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/protocol/protocol.yml
DevTools Protocol: https://chromedevtools.github.io/devtools-protocol/
As you can see there are three different parts

The Playwright language specific code
The Playwright Node.js driver and Node.js runtimes for each platform
The Browsers

The Microsoft.Playwright NuGet package contains the Playwright .NET code (Microsoft.Playwright.dll) as well as the Node.js driver and a bundled Node.js runtimes for each platform. And because these Node.js runtimes are quite big (https://github.com/microsoft/playwright-dotnet/issues/1845) and you most likely only need one of them, we added a PlaywrightPlatform property (https://github.com/microsoft/playwright-dotnet/pull/1955) where you can specify which Node.js runtime you want.
The browsers on the other hand are not included in the NuGet package so you need to run playwright.ps1 install or Microsoft.Playwright.Program.Main(new []{ "install" }) to download them. This isn't done automatically because they are even bigger and there are usecases where you don't need them like

https://playwright.dev/dotnet/docs/browsers#google-chrome--microsoft-edge
https://playwright.dev/dotnet/docs/api/class-browsertype#browser-type-connect
https://playwright.dev/dotnet/docs/api/class-browsertype#browser-type-connect-over-cdp

or you only need one of them like playwright.ps1 install chromium / Microsoft.Playwright.Program.Main(new []{ "install", "chromium" }).

Excellent! Thanks!

WOW... thanks

authors: 304NotModified Cricam campersau

repo: microsoft/playwright-dotnet


text:
BUG: pac auth create for GCC doesn't select right cloud

I am in version 1.32.8 and it seems like running pac auth create, doesn't select the right GCC cloud by default. Currently it defaults to 'Public'. I believe in past, it used to automatically select 'UsGov' when we used the command.

pac auth create without any arguments will always (and has always) targeted the Public cloud.
PAC can figure out the right cloud if you pass your organization's URL to the --environment command, but otherwise would need a --cloud argument to specify explicitly.

repo: microsoft/powerplatform-vscode


text:
Run on Windows 10

Hi,
I need to run an PII data anonymization on .pdf and .jpg documents. This would be a proof of concept to possibly use later in production which would most likely be a Win 2016 Server machine. All would need to be local on prem for security reasons.
Is this possible?
I tried install with KIND but got errors running the steps.
I do have Docker on my Win 10 laptop and have used successfully testing Azure Form Recognizer containers.
Any help most appreciated. If there is a more suitable place for the questions please let me know.
Thanks

Hi @tbp1962,
Thanks for the feedback. Could you please share the KIND errors you were getting?
We don't officially support a Windows deployment, but it might be possible to get everything running using Docker (not using the make file). Try running the commands in build.sh and run.sh to get the containers running. Note that I haven't tried it myself so they might need some adapting from bash to Windows.

Hi,
I played around with the scripts. I think I have the containers up (see attached file).
If they do look usable I'm looking for how to test. I was assuming I would make an API call. Looking at the swagger file it seems they all have {projectID} which I'm not sure what that is referencing.
Looking to send text to anonymize  and .jpg  to anonymize-image and get back PII masked. Not sure of the API calls to make those happen.
Thanks,
T

project_id can be anything. No need to specify anything special.
Regarding anonymize-image, see example 6 here: https://github.com/microsoft/presidio/blob/master/docs/tutorial_service.md

Hi,
Getting connect errors (see attached). I disabled virus and firewall but still no go.
Any help most appreciated.
Thanks

Hi,
On the previous post it may have to do with Docker ports which I can possibly figure out.
The presidio-api keeps stopping for some reason. Stays up for about a minute then goes away. I'm not finding any good info on how to troubleshoot.
I'm assuming I need both presidio-api and presdio-anonymizer-image to anonymize an .jpg.
Thanks

Hi,
I was able to get it working. It looks like you have to have presidio-analyzer up and running in order to run presidio-api and presidio-anonymizer-image.
I started everything in the run.sh except redis. I successfully got results even though in the results it told me "It looks like we don't support this file type." . It was a .jpg .
I'll try with a .png since that was in the example. I thought I saw supported file types listed somewhere but not readily finding it right now.
Thanks

Hi,
I tried .jpg and .png and got same results. Please see attachments.
Thanks

This is what I get.
Thanks

Presidio uses tesseract and its go client. I would check if your image can be parsed using these or there's a different issue.

Hi,
Thanks for looking into the issues.
Unfortunately that is getting beyond my knowledge base with docker and I haven't used tesseract,
We were hoping the service would work like Form Recognizer service and labeling tool container versions as we were able to use without issue.
https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/quickstarts/label-tool
I put everything we were doing in the attached doc. Perhaps you or someone else will see something with our steps that is causing our issues.
Looks like exactly what we need but unfortunately we could not get it to work.
Thanks!
presidio_win_10_docker.docx

I know the original post specifically asked about running this on Windows Server 2016, but I wanted to share that build.sh worked for me on Win10 build 2004. I used ubuntu in WSL2 by following these instructions :
https://docs.docker.com/docker-for-windows/wsl/
which are basically the same steps outline here:
https://code.visualstudio.com/blogs/2020/07/01/containers-wsl#_getting-started
I then installed make with apt, changed the line endings to unix-style with vs code, and it worked great

Hi,
I did as Stephen  @sdolenc suggested and rebuilt everything on my Win 10 machine per the instructions he posted. Thanks for that Stephen!
I did the build which did take some time and posted a lot on the screen. It seemed to finish correctly and I was able to get the presidio-analyzer container up where prior I was not. I successfully did the analyze text example.
My attempt with the anonymize-image example I received the same result, "it looks like we don't support this file format".
Images attached referencing the above.
Thanks!

Hi,
Ok, did some more checking and it appears what is actually in the output.png is:
"open /tmp/myproject5.analyze.myAtemplate1: no such file or directory"
If you look at the output.png with MS Photos you get the "it looks like we don't support this file format" but if you look at it in notepad++ it has the text. The error is the same one I get trying the anonymize text example.
Is is supposed to put a file to /tmp? Wondering if @sdolenc was able to get any of the anonymize to work on his end.
Thanks,
T

@tpb1962 , sorry for the delayed reply. To be honest: I did a cursory check when I wrote my original message (Aug20) and it looked like things were working okay on WSL2. I haven't had the chance to play with Presidio much since then.
I'm hoping others have some suggestions for possible next steps.

Thanks @sdolenc  , no problem on replying.
I actually got it working. I will list my findings and eventually close the issue.
If you have limited knowledge of python and docker like I did then maybe this will be helpful when trying out Presidio.
I'm still awaiting confirmation that what I did was correct and we may possibly update the documentation. My main objective of trying this out was for redaction of documents. As you see from the posts I had some issues right off the bat. Eventually I got most of it working with the help of @omri374  and @sdolenc . It does appear to use on Win 10 I needed the latest Docker for Windows which runs on true Linux kernel. I was able to get all the containers listed in the examples up and running but I still had errors. This was from just running the run.sh script to get them up. I ended up having to run build.sh. This took some time as documented. Once I did that I was able to get Analyze Text working. I'm still not sure why I have to do the build. Perhaps someone can explain. I thought if I had the containers everything was there. Perhaps it is to get the latest from the code base into the containers. Not sure.
With all that working I tried Anonymize Text and Anonymize Image. I tried many things that did not work but after digging into the code, mainly the automated test sections, I found I needed presidio-ocr and presidio-anonymize-image in my list along with the other containers listed from docker ps for Anonymize Image.  I added those to the run.sh with similar entries as the others.
With those I was able to Anonymize Text and Anonymize Image to work. Some other things that threw me were what I needed to have to run successfully. I thought the two items under the examples for anonymize-image were all I needed to process an image. I found out I also needed the first step in the examples that sets an analyze template to "all fields".  You need that with the same project as the one for the anonymize-image. This is needed as well with Anonymize Text.  This fixed the "no such file error" posted earlier. Also note that it places these files in the /tmp of the presidio-api container. What that means in order to see them you need to use the docker exec command, ex: docker exec presidio-api ls -l /tmp . I kept looking at the host /tmp and not finding anything.
This is what I used to test anonymize text and image:
Text: allfields
echo -n '{"allFields":true}' | http localhost:8080/api/v1/templates/mp2/analyze/mt2
echo -n '{"fields":[{"name":"PERSON"}],"transformation":{"replaceValue":{"newValue":""}}},{"fields":[{"name":"US_BANK_NUMBER"}],"transformation":{"replaceValue":{"newValue":"<US_BANK_NUMBER>"}}},{"fields":[{"name":"DATE_TIME"}],"transformation":{"replaceValue":{"newValue":"<DATE_TIME>"}}},{"fields":[{"name":"LOCATION"}],"transformation":{"replaceValue":{"newValue":""}}},{"fields":[{"name":"US_SSN"}],"transformation":{"replaceValue":{"newValue":"<US_SSN>"}}}]}' | http localhost:8080/api/v1/templates/mp2/anonymize/mt2
echo -n '{"text":"my phone number is 057-555-2323 and my credit card is 4961-2765-5327-5913. Address 123 Jump St. Mobile, AL is the place to go. 212-99-9999 Date one is Dec 13, 2020. Date two is Dec 20, 2020.", "AnalyzeTemplateId":"mt2", "AnonymizeTemplateId":"mt2"  }' | http localhost:8080/api/v1/projects/mp2/anonymize

Images: allfields
echo -n '{"allFields":true}' | http localhost:8080/api/v1/templates/redactproject/analyze/allfieldstemplate
echo -n '{"fieldTypeGraphics":[{"graphic":{"fillColorValue":{"blue":0,"red":0,"green":0}}}]}' | http localhost:8080/api/v1/templates/redactproject/anonymize-image/redacttemplate
http -f POST localhost:8080/api/v1/projects/redactproject/anonymize-image detectionType='OCR' analyzeTemplateId='allfieldstemplate' anonymizeImageTemplateId='redacttemplate' imageType='image/jpg' file@./presidio_test_iamges/test1.jpg> test1-output.jpg
It is very possible that I did not understand the instructions and missed it or did not need to do all of this but it is what I had to do to get it to work. Also note that with the test above I got some results that weren't what I was expecting. I will be testing more to get better understanding and possibly open another issue.

Hi @tpd1962. Thanks for the detailed flow and glad you made this work! We are aware of the fact that the anonymize-image doc is lacking some clarity. If you would like to propose a PR to fix this, it would be extremely valuable for others who work on it.

Closing this issue. Review of this stream and pull request #369 should hopefully provide information for people having trouble running on Windows as well as anonymizing images.

repo: microsoft/presidio


text:
missing namespace on code snippet

In empty game, in Monaco, type "game.addScenePushHandler" and do instellisense complete to get

game.addScenePushHandler(function (oldScene: Scene) {

})

Correct code snippet is:
game.addScenePushHandler(function (oldScene: scene.Scene) {

})

Looks like this was actually fixed in https://github.com/microsoft/pxt-monaco-typescript/pull/9 already, but never got released as it's the last commit made in that repo. @riknoll ^^

authors: jwunderl tballmsft

repo: microsoft/pxt-arcade


text:
Block gif appears in the JS tutorial

Describe the bug
Block gif appears in the JS tutorial
Steps to reproduce the behavior
1.Navigate to https://arcade.makecode.com/beta#
2.Tutorials---->Chase the Pizza---->JavaScript Start Tutorial
3.Click Step 4, 7
4.Observe the gif
Expect behavior
There should add a gif about how to do in the JS editor.
Actual behavior
Block gif appears in the python tutorial and maybe it should be deleted.

Additional context
1.OS: Windows(rs6)
2.arcade version: 0.18.15
3.Microsoft MakeCode version: 6.1.28

"Lemon Leak" also has the same issue for step 2

@ganicke Still need to add a gif about how to do in the JS editor for step 7 in "Chase the Pizza"

The gif still is how to do in the Block editor

@ganicke Still need to add a gif about how to do in the JS editor for step 7 in "Chase the Pizza"

The gif still is how to do in the Block editor

@Sheila111 - Thanks for pointing out the mismatch for the pizza pick gif.

@Sheila111 - Thanks for pointing out the mismatch for the pizza pick gif.


text:
large inline hex literals cause compiler error

error TS9200:   -> Line 108982 ('    bge tileworld_Project_setSprites__P497412_nochk'), error: assembly error
Maybe: bge   LABEL (argument out of range or mis-aligned at 'tileworld_Project_setSprites__P497412_nochk')

;
; Function setSprites project.ts:40
;
.section code
.balign 4

tileworld_Project_setSprites__P497412_args:
cmp r4, #2
bge tileworld_Project_setSprites__P497412_nochk
push {lr}
bl _expand_args_2_13
bl tileworld_Project_setSprites__P497412_nochk
@dummystack 2
add sp, #4*2
pop {pc}
.section code
tileworld_Project_setSprites__P497412:
mov r7, lr
ldr r0, [sp, #0]
bl _inst_tileworld_Project__C497407_validate_18
mov lr, r7
tileworld_Project_setSprites__P497412_nochk:
@stackmark func
@stackmark args
push {lr}
.locals:

@stackmark locals

tileworld_Project_setSprites__P497412_locals:
ldr r0, [sp, args@0]
ldr r1, [sp, args@1]
str r1, [r0, #20]
@stackempty locals
.ret.497412:
@stackempty locals
movs r0, #0
bb .final_0_689 ; with expression

.final_0_689:
tileworld_Project_setSprites__P497412_end:
pop {pc}
@stackempty func
@stackempty args
; endfun

test.txt

repo: microsoft/pxt


text:
benchmarks_dynamic example error:  result has failed to un-serialize

I run rm -r mlruns
then run
python rolling_benchmark.py run_all
in the benchmarks_dynamic /DDG-DA dir
Error occured as the title
[10719:MainThread] INFO - qlib.timer - [log.py:117] - Time cost: 0.000s | waiting async_log Done
train tasks: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 151/151 [02:06<00:00,  1.19it/s]
calc: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 151/151 [00:07<00:00, 19.29it/s]
[10719:MainThread](2022-06-24 15:05:49,660) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[BrokenProcessPool: A result has failed to un-serialize. Please ensure that the objects returned by the function are always picklable.].
File "workflow.py", line 259, in
fire.Fire(DDGDA)

I tried executing python ../baseline/rolling_benchmark.py run_all in the benchmarks_dynamic/DDG-DA folder and didn't find this issue, so I suggest creating a new environment and trying again.

创了个新虚环境，报 https://github.com/microsoft/qlib/issues/1166的错。所以暂不知道这个是否还存在

又看了下  我说得是
python rolling_benchmark.py run_all
in the benchmarks_dynamic /DDG-DA dir
报错
你回复的是

python ../baseline/rolling_benchmark.py run_all
不报错。不是一回事啊

python workflow.py run_all

This bug has been fixed in PR 1141 and can be tried again.

创了个新虚环境，报 https://github.com/microsoft/qlib/issues/1166的错。所以暂不知道这个是否还存在

This bug has been fixed in PR 1141 and can be tried again.

calc: 100% 。。。151/151  这步完成了
之后执行结果
[8851:MainThread](2022-06-30 14:06:25,843) INFO - qlib.MetaDatasetDS - [dataset.py:278] - Example task for training meta model: {'dataset': {'class': 'qlib.data.dataset.DatasetH', 'kwargs': {'handler': 'file:///examples/benchmarks_dynamic/DDG-DA/handler_proxy.pkl', 'segments': {'train': (Timestamp('2008-01-02 00:00:00'), Timestamp('2010-12-03 00:00:00')), 'test': (Timestamp('2011-01-04 00:00:00'), Timestamp('2011-01-31 00:00:00'))}}}}
creating meta tasks: 100%| 。。。 | 115/115
然后报错 AssertionError: NaN loss!
[8851:MainThread](2022-06-30 14:09:14,561) INFO - qlib.workflow - [expm.py:315] - <mlflow.tracking.client.MlflowClient object at 0x7f31fbd86130>
[8851:MainThread](2022-06-30 14:09:14,564) INFO - qlib.workflow - [exp.py:257] - Experiment 3 starts running ...
[8851:MainThread](2022-06-30 14:09:14,576) INFO - qlib.workflow - [recorder.py:295] - Recorder f5bae2b9dff24b9caadd8a023ebb23c8 starts running under Experiment 3 ...
[8851:MainThread](2022-06-30 14:09:31,567) INFO - qlib.timer - [log.py:117] - Time cost: 0.000s | waiting async_log Done
[8851:MainThread](2022-06-30 14:09:31,567) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[AssertionError: NaN loss!].
File "workflow.py", line 259, in
fire.Fire(DDGDA)
line 259, in
fire.Fire(DDGDA)
。。。
File "workflow.py", line 249, in run_all
self.train_meta_model()
File "workflow.py", line 174, in train_meta_model
mm.fit(md)
File " anaconda3/envs/py38/lib/python3.8/site-packages/qlib/contrib/meta/data_selection/model.py", line 154, in fit
self.run_epoch(f"{phase}_noweight", task_list, 0, opt, {}, ignore_weight=True)
File " anaconda3/envs/py38/lib/python3.8/site-packages/qlib/contrib/meta/data_selection/model.py", line 96, in run_epoch
assert not np.isnan(loss.detach().item()), "NaN loss!"

calc: 100% 。。。151/151  这步完成了
之后执行结果
[8851:MainThread](2022-06-30 14:06:25,843) INFO - qlib.MetaDatasetDS - [dataset.py:278] - Example task for training meta model: {'dataset': {'class': 'qlib.data.dataset.DatasetH', 'kwargs': {'handler': 'file:///examples/benchmarks_dynamic/DDG-DA/handler_proxy.pkl', 'segments': {'train': (Timestamp('2008-01-02 00:00:00'), Timestamp('2010-12-03 00:00:00')), 'test': (Timestamp('2011-01-04 00:00:00'), Timestamp('2011-01-31 00:00:00'))}}}}
creating meta tasks: 100%| 。。。 | 115/115
然后报错 AssertionError: NaN loss!
[8851:MainThread](2022-06-30 14:09:14,561) INFO - qlib.workflow - [expm.py:315] - <mlflow.tracking.client.MlflowClient object at 0x7f31fbd86130>
[8851:MainThread](2022-06-30 14:09:14,564) INFO - qlib.workflow - [exp.py:257] - Experiment 3 starts running ...
[8851:MainThread](2022-06-30 14:09:14,576) INFO - qlib.workflow - [recorder.py:295] - Recorder f5bae2b9dff24b9caadd8a023ebb23c8 starts running under Experiment 3 ...
[8851:MainThread](2022-06-30 14:09:31,567) INFO - qlib.timer - [log.py:117] - Time cost: 0.000s | waiting async_log Done
[8851:MainThread](2022-06-30 14:09:31,567) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[AssertionError: NaN loss!].
File "workflow.py", line 259, in
fire.Fire(DDGDA)
line 259, in
fire.Fire(DDGDA)
。。。
File "workflow.py", line 249, in run_all
self.train_meta_model()
File "workflow.py", line 174, in train_meta_model
mm.fit(md)
File " anaconda3/envs/py38/lib/python3.8/site-packages/qlib/contrib/meta/data_selection/model.py", line 154, in fit
self.run_epoch(f"{phase}_noweight", task_list, 0, opt, {}, ignore_weight=True)
File " anaconda3/envs/py38/lib/python3.8/site-packages/qlib/contrib/meta/data_selection/model.py", line 96, in run_epoch
assert not np.isnan(loss.detach().item()), "NaN loss!"

hi！How to solve it 。I have the same problem

hi！How to solve it 。I have the same problem

Same problem!
File "/data/pengqlu/miniconda3/envs/gnn/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "examples/benchmarks_dynamic/DDG-DA/workflow.py", line 252, in run_all
self.train_meta_model()
File "examples/benchmarks_dynamic/DDG-DA/workflow.py", line 177, in train_meta_model
mm.fit(md)
File "/home/pengqlu/code/qlib/qlib/new_qlib/qlib/./qlib/contrib/meta/data_selection/model.py", line 154, in fit
self.run_epoch(f"{phase}_noweight", task_list, 0, opt, {}, ignore_weight=True)
File "/home/pengqlu/code/qlib/qlib/new_qlib/qlib/./qlib/contrib/meta/data_selection/model.py", line 96, in run_epoch
assert not np.isnan(loss.detach().item()), "NaN loss!"
AssertionError: NaN loss!

authors: RRdmlearning RocStone SunsetWolf jingmouren

repo: microsoft/qlib


text:
get_risk_degree not in BaseStrategy

📖 Documentation
In this part from the document, " All strategy classes need to inherit the base class and implement its interface. get_risk_degree and generate_order_list". However, in current version of code. Class BaseStrategy does not have these two methods. Class SBBStrategyBase does not have these two methods either.

Sorry, the doc is too old and for previous version
The latest version of the code is https://github.com/microsoft/qlib/blob/main/qlib/strategy/base.py#L117
The generate_trade_decision is the key interface.

@you-n-g I see. In my humble opinion, it is the right time to refine the document.

@SunsetWolf  will help to fix this part of the docs.

This issue is fixed in this PR.

authors: SunsetWolf tengerye you-n-g


text:
QirRuntime: readme updated, remove unused files

Interop tests were verifying C-APIs that were on top of IQuantumApi and don't exist anymore. Shouldn't have been committed but somehow slipped through.

@bettinaheim, @alan-geller, @swernli : This is a small cleanup of Qir Runtime readme and unused files. Could someone please rubber-stamp it? Thanks!

I'm looking right now...

From: Irina Yatsenko notifications@github.com
Sent: Friday, November 13, 2020 3:43 PM
To: microsoft/qsharp-runtime qsharp-runtime@noreply.github.com
Cc: Alan Geller Alan.Geller@microsoft.com; Mention mention@noreply.github.com
Subject: Re: [microsoft/qsharp-runtime] QirRuntime: readme updated, remove unused files (#440)
@bettinaheimhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbettinaheim&data=04|01|alan.geller%40microsoft.com|7a25011b5be7413483f708d8882dfe2c|72f988bf86f141af91ab2d7cd011db47|1|0|637409078404339482|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=aG3hzB%2F9bfRiRh6OpSW8L3%2BO9mxQD5uufp9d%2FtyVyk8%3D&reserved=0, @alan-gellerhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Falan-geller&data=04|01|alan.geller%40microsoft.com|7a25011b5be7413483f708d8882dfe2c|72f988bf86f141af91ab2d7cd011db47|1|0|637409078404344473|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=F7GPin5xhN22HHv3bPlZHKF7IbbExW0rMH56klJSQrs%3D&reserved=0, @swernlihttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fswernli&data=04|01|alan.geller%40microsoft.com|7a25011b5be7413483f708d8882dfe2c|72f988bf86f141af91ab2d7cd011db47|1|0|637409078404349464|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=j6QNhCApPV4eVhJCAlG2hohmNTiR4AcnH70vGboOVMA%3D&reserved=0 : This is a small cleanup of Qir Runtime readme and unused files. Could someone please rubber-stamp it? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fqsharp-runtime%2Fpull%2F440%23issuecomment-727087157&data=04|01|alan.geller%40microsoft.com|7a25011b5be7413483f708d8882dfe2c|72f988bf86f141af91ab2d7cd011db47|1|0|637409078404354458|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=dvtELFhQpxw8N5PqM9RMXMQa6EBGhUUEaFgh449gOeg%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACROCGNKNUVORZ22OL2CJ7LSPXAD5ANCNFSM4TT5WQLA&data=04|01|alan.geller%40microsoft.com|7a25011b5be7413483f708d8882dfe2c|72f988bf86f141af91ab2d7cd011db47|1|0|637409078404359445|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=4ca5fM1OQ%2FVbTSf%2BlJxs5J2KDXt9uiLt2FIhVwePskI%3D&reserved=0.

Thank you, Alan!

authors: alan-geller irinayat-MS

repo: microsoft/qsharp-runtime


text:
Issues with multiple service decorators on the same method

AFAIU decorating the same method with multiple group decorators is allowed.  This scenario is not tested in rats.apps - I broke it in the first iterations of https://github.com/microsoft/rats/pull/124 and passed unit tests but broke rats-devtools.
Do we allow decorating the same method with multiple service decorators too?  I don't see why not, but it was not allowed in previous versions.  Likewise for the rest of the decorators.
The caching of service methods should move from the decorator to AnnotatedContainer.get_namespaced_group.  The contract for a service is that you get the same service object in all calls for the same service id.  But users should expect different objects for different service ids, regardless of whether they were defined using the same method or not.

@ms-lolo

will think about this a little and get back to you but my first impression is that your point #3 is correct and we should allow multiple services to be tied to one provider and the caching should be based on the service id, not the provider function. but in that case, the caching expectation might belong in the Container API and not just the annotated containers, but I'm not sure if that's possible

i think we have a good solution in our main branch now. providers functions are not cached but the getter for each service id is, so one provider with multiple ids will give each id a new instance, consistently.
reopen if i missed something!

authors: elonp ms-lolo

repo: microsoft/rats


text:
ci: set up a job to test our tools in a new project using pnpm

Our repo isn't set up to test symlinks properly. We should create a new CI job that creates a clean project with pnpm and run all our tools there.
Maybe this can use #1263 to create the project.

#1264 covers the test cases. I added a note about using pnpm in the test matrix.

repo: microsoft/rnx-kit


text:
Stepwise Planner doesn't updates Context Variables from actions

Describe the bug
Stepwise Planner doesn't  take context variable from previous step/action
To Reproduce
Steps to reproduce the behavior:

Create 2 native functions
Function 1 fetches data and say sets context[Variable1]
Function 2 uses context[Variable1] to summarize the data
Create sstepwise plan using Stepwise Planner
Planner plans Action 1 -> Function1 and Action 2 -> Function2
[bug] Function 2, will not able to find context[Variable1], as Action 1, didn't update the original context

Expected behavior
Chaining of functions should respect context variables set by previous function
Screenshots
Desktop (please complete the following information):

OS: [e.g. Windows] - Windows
IDE: [e.g. Visual Studio, VS Code] - Visual Studio
NuGet Package Version [e.g. 0.1.0] - 0.17.230704.3-preview

Additional context
Add any other context about the problem here.

Fix : https://github.com/microsoft/semantic-kernel/issues/1894

Fix : #1894

Off by one error :) I think you meant to link #1893

Right now it's kind of by design. The intent is that the model will populate parameters defined based on the previous step observation. We want to avoid 'hidden' outputs in contexts.

repo: microsoft/semantic-kernel


text:
Python: Create v1 proposal sample

To validate what is necessary to get to V1 for Python, we need to create a similar set of samples as what is available here: https://github.com/matthewbolanos/sk-v1-proposal
The samples should highlight the main changes being made to the kernel.

On it!

Have a look here: https://github.com/matthewbolanos/sk-v1-proposal/tree/main/python

Marking this as complete

authors: eavanvalkenburg matthewbolanos


text:
No Linux\ubuntu tab present in new build

Can you provide a bit more information?

please run wsl -l

You can add wsl to the drop-down by editing and adding the following lines in the setting (profiles.json) file, along other options...
{
"guid":"{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
"name":"WSL",
"colorscheme":"Campbell",
"historySize":9001,
"snapOnInput":true,
"cursorColor":"#FFFFFF",
"cursorShape":"bar",
"commandline":"wsl.exe",
"fontFace":"Consolas",
"fontSize":12,
"acrylicOpacity":0.75,
"useAcrylic":true,
"closeOnExit":false,
"padding":"0, 0, 0, 0"
}

I'm guessing that WSL isn't installed or you have no distributions. If neither of these are true, please reopen the issue and provide the output of wsl -l
Thanks!

authors: DHowett-MSFT aadarshashutosh sahil315

repo: microsoft/terminal


text:
[High Contrast] SUI titles have too low contrast ratios

Contrast ratio shown is 2.7:1

FYI, this is probably due to #13065, because the background color is red, when it shouldn't be.


text:
clear leaves the first line currently displayed over

Windows terminal version
1.13.11432.0
Windows build number
10.0.22000.795
Other software
None.
Steps to reproduce

Open PowerShell or Command prompt.
Make the text span more than one screen.
Run clear or cls.
Use the mouse wheel to scroll up.

Expected behavior
The scroll isn't possible as there is no longer any text above the currently displayed screen section.
Actual behavior
There is one line left over that is shown when scrolling up, which is the first line in the currently displayed screen section before the clear command is executed. When typing the scrolling snaps back to the line with the prompt, hiding the leftover line.

I fully suspect that this is the same issue we fixed in #13324, which we were originally tracking in /dup #5770


text:
Feature Request: Support the new cross-platform PowerShell

Description of the new feature/enhancement

Proposed technical implementation details (optional)

Hello, Windows Terminal doesn't support the new cross-platform PowerShell.
Please add below feature:

Support the new cross-platform PowerShell

I bet that if you update to the latest store version (v0.5), powershell core will just appear for you 😉
Granted, that's only for the release versions of Powershell Core. For the preview versions, see #2300.

Now I installed the latest store version of Terminal.

Also now I installed the latest store version of PowerShell.

authors: amirrammari zadjii-msft


text:
Use split panes by default

Hello,
I need split panes by default:

What changes should I make to the settings.json?

Thanks for the suggestion! Please make sure to search for duplicates when filing new issues. This is already being tracked by another issue on our repo - please refer to #756 for more discussion.
/dup #756


text:
Visual Error - shortcut CTRL+SHIFT+[dash,equals]

Environment
WT Version 1.1.2233

Steps to reproduce

Have  lots of different profiles defined.
In settings.json extend additional shortcuts from the existing 1 to 9 for 0, - (dash), and = (equals) so that CTRL+SHIFT+[key] opens respective profile

Expected behavior
In the menu for opening a tab/profile, the shortcut for extended shortcuts should appear as logically expected
Actual behavior
In the menu for opening a tab/profile, the shortcut newly defined 0 is appear next to relevant profile but the shortcut for dash and equals do not appear.

Could you share the actual json you've added for these keybindings?

The relevant lines below; the shortcut themselves do work and I can open the tab/profiles with them fine.
        { "command": { "action": "newTab", "index": 7 }, "keys": "ctrl+shift+9" },
        { "command": { "action": "newTab", "index": 8 }, "keys": "ctrl+shift+0" },
        { "command": { "action": "newTab", "index": 9 }, "keys": "ctrl+shift+-" },
        { "command": { "action": "newTab", "index": 10 }, "keys": "ctrl+shift+=" },

It looks like we only actually do this for the first 9 profiles:
https://github.com/microsoft/terminal/blob/93d266925cfce92c1f321c43e10809d624cd2b94/src/cascadia/TerminalApp/TerminalPage.cpp#L465-L468
This is probably because we had 9 hardcoded "switch to tab" commands and it was not possible to add a custom index when we first wrote this code :smile:

Ho boy would you look at that. Yep, we should fix that

Just noticed - for some reason there seems to be some bug in the shortcut handling - with the JSON snippet above; CTRL+SHIFT+9 works.  So does CTRL+SHIFT+[dash].  But the one in the middle CTRL+SHIFT+0 oddly does nothing.
So there is two bugs, the OP with [dash] [equals] shortcuts not appears and additionally the sequence CTRL+SHIFT+0 not being handled.

If you have multiple keyboard layouts enabled, Ctrl+Shift+0 is reserved by Windows as a keyboard layout switch command.

If you mean multiple languages - no I don't have anything like that installed.
Not sure what other layouts you could mean but happy to look into if you give me a pointer on where to check the windows setting.
Anyway; if you are sure this is not a bug and expected behaviour due to windows outside; then can ignore.

authors: DHowett kellytrinh zadjii-msft


text:
Cross tab/pane variable use

Description of the new feature/enhancement
The ability to declare variables in one pane or tab and call them from another. This might be difficult/impossible across different types of pane instances (e.g. one PowerShell and one bash), but at least for panes that are the same type.
A user could use this for a multi-pane set up where one is for live data that sets a variable as it continuously runs and the other pane is used for any quick analytics on the most recent variable declaration.
This could be accessed by the tab/pane ID or name along with the variable. Something like a declaration of variable $users in Tab-2. Then in Tab-1 someone could call Tab-2.$users and retrieve the data set in Tab-2.

Can you provide a bit more detail for your example of how this would be used? Pretend what you wanted existed, how does that look to you from a practical perspective. (I have some data i've grabbed from a mongo db that I want to call in a variable that can be reached from another tab/pane). Something like that (not sure if I accurately got the sentiment down).

In principle, part of this could be implemented with a format similar to xterm's OSC 52 (Manipulate Selection Data). However, it would require changing the shells as well, and I think those changes would be unlikely to be accepted if the feature were not supported by any other terminals.
PowerShell variables have the extra complication that their values might not be serializable.

Thanks for the request! I'd rather offer application developers, and shell users, better forms of IPC than "they happen to be living in the same Terminal". Sorry!
I'm going to close this one out in favor of ecosystem improvements that everybody can get behind, not something that's specific to one or two terminal emulators on Windows.

authors: DHowett KalleOlaviNiemitalo M-Watson WSLUser


text:
White square around elements

Description of the new feature/enhancement
Not sure if this is a future, but ... This white square pokes me out of myself when using a hotkey.
By the way, this is a problem with the windows 10 interface as a whole, I see this in office, in the calculator, and in many other places in modernUI applications.

Proposed technical implementation details (optional)

Yeah...I think this is out the scope of this repo.

In some programs, I have never noticed this, or it seems to me that this is also a windows 10 problem?

When you are using flat menus, a highlighted menu item is surrounded by a border with a different system colour.  This is not a Windows Terminal thing.

Indeed. This is the keyboard focus indicator, and it is going to be present anywhere you access ancillary UI by using the keyboard.


text:
glob dependency is not updated

glob package version is not updated and latest updates can be seen only in ">v9.0".
tfx-cli@0.17.0
│ ├─┬ archiver@2.0.3
│ │ ├─┬ archiver-utils@1.3.0
│ │ │ └── glob@7.2.3 deduped
│ │ └── glob@7.2.3 deduped
│ ├── glob@7.1.2
│ └─┬ shelljs@0.8.5
│   └── glob@7.2.3 deduped
This glob@7.2.3 needs to be updated to >9.0.0

Hi @veeranjaneya-reddy. Thanks for reporting!
We will update the deprecated dependencies soon

thanks @DenisNikulin5

Any update on this please @DenisNikulin5!!

repo: microsoft/tfs-cli