Optimize desugaring of match expressions

This issue calls for implementation of a runtime efficient desugaring of match expressions. The proposal is to combine and to adapt to Sway:

the pattern-matching compiler as explained in the Chapter 5 of  "The Implementation of Functional Programming Languages"
and the concept of join points as explained in the paper "Compiling without continuations"

Such combination was successfuly implemented by @vaivaswatha in the Scilla programming language:

https://github.com/Zilliqa/scilla-compiler/blob/master/src/astlowering/FlattenPatterns.ml

The goal of the proposal is not change the existing desugaring approach and not to introduce desugaring specific AST nodes. We will still desugar to if-else structure using only the regular Sway language features.
Motivation
Currently we desugar match expressions into a straightforward if-else chain. This desugaring is inefficient at runtime. Consider the following example:
match e {
    Enum::A(11) => 1011,
    Enum::B(11) => 2011,
    Enum::A(22) => 1022,
    Enum::B(22) => 2022,
    Enum::A(_) => 1099,
    Enum::B(_) => 2099,
};

The desugared expression will be semantically equivalent to this pseudo-Sway code:
let __match_val = e;
if (__match_val is Enum::A) && (__match_val as u64) ==  11 {
    1011
}
else if (__match_val is Enum::B) && (__match_val as u64) ==  11 {
    2011
}
else if (__match_val is Enum::A) && (__match_val as u64) ==  22 {
    1022
}
else if (__match_val is Enum::B) && (__match_val as u64) ==  22 {
    2022
}
else if (__match_val is Enum::A) {
    1099
}
else if (__match_val is Enum::B) {
    2099
}
else {
  ... // Not relevant for the topic of optimization.
}

It is obvious that the original match expression can be more efficiently desugared into form in which each variant is scrutinized and casted only once:
let __match_val = e;
if (__match_val is Enum::A) {
   let __val = __match_val as u64;
   if __val == 11 {
      1011
   }
   if __val == 22 {
      1022
   }
   else {
      1099
   }
}
else (__match_val is Enum::B) {
  ... // Similar for Enum::B
}
else {
  ... // Not relevant for the topic of optimization.
}

The pattern-matching compiler explained in the Chapter 5 of  "The Implementation of Functional Programming Languages" provides a general algorithm for a similar optimization of an arbitrary match expression.
Join Points
Applying the algorithm as it is can lead to unwanted duplication of nodes in the generated code. An obvious example are OR match arms in Sway that can simply be treated as separate arms. E.g.
match e {
    Enum::A | Enum::B => <some complex code>,
    Enum::C | Enum::D => <some other complex code>,
    _ => <some default complex code>,
};

will be seen by the algorithm as:
match e {
    Enum::A => <some complex code>,
    Enum::B => <some complex code>,
    Enum::C => <some other complex code>,
    Enum::D => <some other complex code>,
    _ => <some default complex code>,
};

The end result of the optimized desugaring will contain duplicated code.
Note that this code duplication also happens even if we do not have OR match arms. E.g.
match e {
    Enum::A(11) => 1011,
    Enum::B(22) => 2022,
    _ => <some default complex code>
};

This will be desugared into:
let __match_val = e;
if (__match_val is Enum::A) {
   let __val = __match_val as u64;
   if __val == 11 {
      1011
   }
   else {
      <some default complex code>
   }
}
else (__match_val is Enum::B) {
   let __val = __match_val as u64;
   if __val == 22 {
      2022
   }
   else {
      <some default complex code>
   }
}
else {
      <some default complex code>
}

The concept of join points as explained in the paper "Compiling without continuations" explains how the code duplication can be replaced by function calls of a special join semantics. In the Scilla programming language the joins were implemented by jumps to code locations called join points.
Proposal
At the moment we do not support local functions, but we discussed to support them. Proposal is to implement local functions first, and then (re)use them as join points. Such local functions can be even flagged as join points so that their join points semantics is further preserved in optimizations as described in the paper. But otherwise, they would be just regular local functions.
The obvious benefit of this approach is elimination of need for a separate construct of joint point and jumps to join points that would need to be considered in AST, analysis, etc. Jumping to a join point would be just a regular local function call.
In the above example, the final elses:
else {
  <some default complex code>
}

would become:
else {
  __fun_some_default_complex_code(...)
}
...
fn __fun_some_default_complex_code(...) -> u64 { // Local function.
  <some default complex code>
}

The goal of the proposal is not change the existing desugaring approach and not to introduce desugaring specific AST nodes. We will still desugar to if-else structure using only the regular Sway language features.

So we won't be translating it to jumps? but just a more efficient form of if-else structures. Maybe do the entire de-sugaring later in the compiler but translate to jumps then?
Other than this, it looks good to me !.

So we won't be translating it to jumps? but just a more efficient form of if-else structures.

I pondered about this a lot. Right now we do not have a dedicated layer like MIR in Rust that has on one side less concepts and on the other side additional concepts not existing in the language itself (e.g. no loops, but gotos in addition and switches, ...) and is optimal for optimizations that can be done above IR level.
Introducing jumps on the AST level would make sense if we had something like MIR. In that case I would expect having other constructs there that simplify code constructs and turning it into a form easier to optimize. Actually we would be talking about adding jumps to MIR.
And doing it later in the compiler would mean the later stages need to know the match expression construct which is now not the case since they get regular ifs.
That's why this approach looked to me as the most fitting in regard to our current architecture. We desugar the match expression to already efficient if-else structure and still allow further optimizations of that structure down the chain.

Hmmm, revoking my thoughts and rethinking it 🤔 Our IR is MIR. Which means we could bring match expressions all the way down to it and do the jumps there.
I am open to both approaches.

Hmmm, revoking my thoughts and rethinking it 🤔 Our IR is MIR. Which means we could bring match expressions all the way down to it and do the jumps there.
I am open to both approaches.

My vote is for translating to jumps if we can. I'm guessing that if we do that, we'll need a switch construct in the IR, similar to LLVM's switch. Since the IR and asm-gen infrastructure doesn't have that yet, we will need to do this whole optimization under a compiler flag. Until the support is there, the flag should default to have it generate if-else and not switch, so that we have some time and space to support the IR / asm-gen parts.

I'm guessing that if we do that, we'll need a switch construct in the IR

Yes we will need switch in that case.

To sum up the discussion so far, we have two options with different tradeoffs:

Stay on the current path and desugar match expression into if-else and other constructs already available in the language (assuming we want to have local functions one day). Optimize the if-else constructs on this level (with further optimizations on the IR level, but those are not aware of switch expressions).
Leave match expression as it is without desugaring and translate it into optimized chains of IR's switches.

Option 1) means there is no need to change the analysis that comes after the type-checking phase. It is still only ifs. There are no changes in the IR either. The drawback is I guess the lack of possible further optimizations on the IR level that we would have if switch were there.
Option 2) is exactly the opposite, with the effort on both analysis and IR side.
Out of my current knowledge about IR and analysis which is very thin on both sides I cannot judge the tradeoffs (looking forward to more learning about those part of Sway!).
@vaivaswatha @tritao if you could provide more info that would be great.

@ironcev Your summary seems about right to me. I don't have anything much to add. If we decide to go down Option 2, please create a new Issue to track switch support in the IR and assign it to me.

Thanks for the feedback @vaivaswatha @tritao! Let's sleep over it and see. In the first step I want to fix the open issues that we have in the phases that precede the desugaring/optimization.


ChimeHQ/LanguageClient not showing docs

https://swiftpackageindex.com/ChimeHQ/LanguageClient

It's weird, the build simply skips over doc building:
Build complete.
========================================
GenerateDocs
========================================
Done.
========================================
ReportResult
========================================
Save logs (attempt 1)
Dependency count: 7.
Sending result (attempt 1)
✅  Result reported

LanguageServer has no docs whatsoever:

Oh wait, I rebuilt 0.2.6 - but that has not .spi.yml yet: https://github.com/ChimeHQ/LanguageClient/tree/0.2.6

Ok, the problem is that main failed the doc build stage:
GenerateDocs
========================================
Generating docs at path:  spi-builder-workspace/.docs/chimehq/languageclient/main
Repository:               ChimeHQ/LanguageClient
Swift version used:       5.7
Target:                   LanguageClient
error: 'spi-builder-workspace': Invalid manifest
/Users/builder/builds/ogLoW6xX/3/finestructure/swiftpackageindex-builder/spi-builder-workspace/Package.swift:7:40: warning: 'v10' is deprecated: iOS 11.0 is the oldest supported version
    platforms: [.macOS(.v10_13), .iOS(.v10), .tvOS(.v10), .watchOS(.v3)],
                                       ^
/Users/builder/builds/ogLoW6xX/3/finestructure/swiftpackageindex-builder/spi-builder-workspace/Package.swift:7:53: warning: 'v10' is deprecated: tvOS 11.0 is the oldest supported version
    platforms: [.macOS(.v10_13), .iOS(.v10), .tvOS(.v10), .watchOS(.v3)],
                                                    ^

Here's the full build log: https://swiftpackageindex.com/builds/BCED38A0-2CFA-4890-87CD-5149EFC416AA

Fixed via upstream iOS, tvOS version bump and rebuild:
https://swiftpackageindex.com/ChimeHQ/LanguageClient/main/documentation/languageclient


Bump go.mod deps

@howardjohn: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

gencheck_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test gencheck

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@howardjohn: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

gencheck_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test gencheck

lint_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test lint

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@howardjohn: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

gencheck_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test gencheck

lint_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test lint

unit-tests-arm64_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test unit-tests-arm64

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@howardjohn: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

gencheck_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test gencheck

lint_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test lint

unit-tests-arm64_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test unit-tests-arm64

unit-tests_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test unit-tests

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@howardjohn: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

lint_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test lint

unit-tests-arm64_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test unit-tests-arm64

unit-tests_istio
3619ceaa010d49f7b922b043b5ba6fb848554eb8
link
true
/test unit-tests

gencheck_istio
fe227a17e6cab6efcd79df64206917a3a7471889
link
true
/test gencheck

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.


Updates to observables in firstUpdated not working

I haven't had a chance to dig into this too much, but I'm noticing that setting an observable that the render method uses in firstUpdated doesn't trigger a rerender. Setting a LitElement property does, as expected. Here's a simple example of what I mean:
// Doesn't work - render isn't called again
class Component extends MobxLitElement {
  @observable test = 1;

  firstUpdated() {
    this.test = 2;
  }

  render() {
    return html`<h1>${this.test}</h1>`;
  }
}

// Works as expected
class Component extends MobxLitElement {
  @property({type: Number}) test = 1;

  firstUpdated() {
    this.test = 2;
  }

  render() {
    return html`<h1>${this.test}</h1>`;
  }
}

I'll try poking around in the source a bit more to learn a bit about what's going on under the hood, but I wanted to open the issue first.

Interesting, please let me know how your investigations pan out and I'll try and take a deeper look at this asap.

Have produced a quick repro:
https://stackblitz.com/edit/typescript-zpfftr

Ok what appears to be happening is that the observable tracking from the Reaction setup is not completed until after firstUpdated is called, this is due to firstUpdated being called synchronously after the render completes.
The Reaction we setup is observing the access through the performUpdate function which in turn triggers render, but the reaction captures the state after this function completes. So making a change in firstUpdated is not detected because its already set to the new value as far as the Reaction is concerned..
Not exactly sure the best approach here to fix. @justinfagnani any suggestions? I feel like we 'could' requestUpdate after track to force a second render pass to capture any changes after firstUpdate but this seems less than ideal in the majority of cases where state is not modified in firstUpdate. However we're clearly violating the description of firstUpdated right now so we do need to fix this one somehow I think?

One approach that appears to work is to create the Reaction over the update method rather than performUpdate, this way the reaction is setup over the state before firstUpdated is called and we get a requestUpdate reaction after firstUpdated completes. @justinfagnani do you see any issues with this?

I suspect this will also be a problem for state changes in updated(), and in update() after the super.update() call.

I guess we could setup separate reactions around each of these functions in a similar manner? Its a little more code, but not a lot, and I guess would solve in each case.

Tracking super.update() might be ok. Then any subclasses that make state changes after their own super.update() call should work.

@cannoneyed this fix has been published under 0.0.4.

Amazing! Thanks so much, might be the fastest fix I've ever seen!


ttkbootstrap dosen't like tkinter Label, Button.....

Desktop (please complete the following information):
Traceback (most recent call last):
File "PROJECT DIRECTORY", line 8, in
import ttkbootstrap as ttk
File "PROJECT DIRECTORY", line 132, in
Title = ttk.Label(master=root, text="Truth or Dare!", font="Courier 24")
^^^^^^^^^
AttributeError: partially initialized module 'ttkbootstrap' has no attribute 'Label' (most likely due to a circular import)
Describe the bug
My tkinter program works fine but when I try to import ttkbootstrap it breaks. It says that .Label, .Button are not defined in the ttkbootstrap code file
To Reproduce
No response
Expected behavior
No response
Screenshots
No response
Additional context
No response

Hi @AlexiJemano,
Can you share the imports section from your code? The AttributeError: partially initialized module, you are getting sounds quite similar to this issue from SO: https://stackoverflow.com/questions/59762996/how-to-fix-attributeerror-partially-initialized-module


Fix throwIfFalseEOF if skip method was called before read

throwIfFalseEOF method don't take into account bytes read/skipped in skip method and throws IOException when legit EOF was reached.

Can we add a test for this?
It looks like we can add something like this:
  public void testSkippingBytes() throws IOException {
    MockHttpURLConnection connection = new MockHttpURLConnection(null)
        .setResponseCode(200)
        .setInputStream(new ByteArrayInputStream(StringUtils.getBytesUtf8("0123456789")))
        .addHeader("Content-Length", "10");
    NetHttpResponse response = new NetHttpResponse(connection);
    InputStream is = response.getContent();
    // read 1 byte, then skip 9 (to EOF)
    assertEquals('0', is.read());
    assertEquals(9, is.skip(9));
    // expect EOF, not an exception
    assertEquals(-1, is.read());
  }

Thanks for the test, added it to PR

@medb Is it possible to rebase these changes off of the "dev" branch? Strangely, the "dev" branch is the primary branch, not "master" and the CI config in that branch cannot be run.

Rebased on dev branch

Thanks!


Fine tuning Docker container dependencies

:tada: This PR is included in version 1.6.0 :tada:
Your semantic-release bot :package::rocket:


Implement syslog output to store under /var/log

Won't do. It will be running as a systemd service and the output will be processed by journald. Journal can be configured to also produce output to files under /var/log.


Enable code coverage on codecov.

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@b5c3b4d). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main       #8   +/-   ##
=======================================
  Coverage        ?   98.15%
=======================================
  Files           ?        9
  Lines           ?      325
  Branches        ?        0
=======================================
  Hits            ?      319
  Misses          ?        6
  Partials        ?        0

Help us with your feedback. Take ten seconds to tell us how you rate us.


Added a simple .wants command

Which shows who has affinity to you. Separated by which ones you own. No longer includes my token...
Also indenting is whatever, it's not Python.

Can it get renamed to .waifuwants

Is the alias fine?

bump

Any news on this one? :thinking:

What hasn't (until now) made it into this thread is @Kwoth's comments along the lines of "I don't see the point of having a new command for this". There was a brief consideration about adding it to .waifuinfo, though even that's apparently going to be a hard sell.
I think this information is extremely useful, personally, but I haven't come up with any better way of including it than the waifuinfo addition. I suppose I should at least do that and then see.

https://puu.sh/AwpbP.png - with an unclaimed affinity
https://puu.sh/Awpbw.png - with a claimed affinity. The * is not currently explained anywhere. I'm considering splitting that into two fields to be explicit about it, but I like the idea of it just showing up in the middle of the list. (The original intent of this is to allow you to see people you might want to claim, because they have affinity set. Seeing people you hold who have affinity or not is useful for considering divorces, but isn't something I explicitly care about supporting. Just figured it would be easy to do while I was at it.)

Wouldn't it make more sense to put a 💞 for claimed person with affinity towards you

Can you change "Desires you" to "Loved by"

Oh, both of those are great ideas. I'll do that promptly.
On 3 June 2018 at 15:46, Master Kwoth<EMAIL_ADDRESS>wrote:

Can you change "Desires you" to "Loved by"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Kwoth/NadekoBot/pull/1935#issuecomment-394138882, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AEX90byJBzU20PhwPjtUJAw5nPJwm_kQks5t43hMgaJpZM4REmY5
.

@Kwoth 👀

I'll consider this in 3.0


Bump deps

This PR bumps the crate dependencies, most notably zeroize which has now yanked all pre-1.0 versions (i.e. this crate now doesn't work). The PR also uses the criterion crate because cargo-bench isn't staying around.

Where are the benchmark results?
    Finished bench [optimized] target(s) in 2m 09s
     Running target/release/deps/deoxysii-70232a988aa02f29

     Running target/release/deps/mrae-4cca5e582f431c72
running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out


Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: be16c8cd-c7df-baf4-f649-64250f8e3fc9
Version Independent ID: 0cead786-5529-c4a0-31cc-047a3affe4b2
Content: Windows Presentation Foundation
Content Source: docs/framework/wpf/index.md
Product: dotnet-framework
GitHub Login: @dotnet-bot
Microsoft Alias: dotnetcontent

We're sorry that you're having difficulties with sizing the calendar in the DatePicker control, @yetanotherlogonfail.  You might find this StackOverflow question helpful.

Typical
This is a typical "Microsoft" response... you find a post that describes
the issue but not how to solve it, your parents must be proud.
why don't people think ? you have now wasted MORE of my valuable time. but
thanks for trying.
On Fri, 3 Aug 2018 at 17:54, Ron Petrusha<EMAIL_ADDRESS>wrote:

We're sorry that you're having difficulties with sizing the calendar in
the DatePicker control, @yetanotherlogonfail
https://github.com/yetanotherlogonfail. You might find this StackOverflow
question
https://stackoverflow.com/questions/32522503/datepicker-issue-calendar-size-is-too-big
helpful.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/docs/issues/6820#issuecomment-410313367, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGIVWk96J9bWLK8VYeV997piGuZGqKfKks5uNIA4gaJpZM4VuGim
.

--
Regards, Carl
Average minds discuss people, good minds discuss events but great minds
discuss ideas


starting field tests

Codecov Report

Merging #9 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master       #9   +/-   ##
=======================================
  Coverage   81.81%   81.81%
=======================================
  Files           4        4
  Lines          99       99
=======================================
  Hits           81       81
  Misses         18       18

Impacted Files
Coverage Δ

pydantic2graphene/types.py
100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9323108...6c96261. Read the comment docs.


Fixing orientation changes a file size

Hi,
There is a problem when I setup ngf-fix-orientation="true". My file is 2MB big and I setup max file size to 3MB.
When image is loaded then orientation is fixed and file size increases 3 times ! to 6MB and validation does not take it into consideration.
I believe that fixing file orienetation shouldn't cause image size increase.

Fixed at version 11.0.0


kvstore: remove obsolete key encoding/decoding methods

The Consul backend had some special restrictions wrt. key encoding. That backend was removed in commit f323ffc16d79 ("kvstore: Remove Consul support"). The remaining etcd backend doesn't have these restrictions so the key encoding/decoding step can be omitted. All the decode/encode methods did was converting from []byte to string and back or vice versa. This might have caused unnecessary allocations in some cases.

/test

/test

/test


Question: How to transform calcaulted hamiltonian/fock, overlap, MO coeff matrix if input geometry is rotated?

Say for a particular geometry r I have already calculated the Fock matrix F, overlap matrix S, and molecular orbital coefficients C. If I apply a simple rotation matrix R to the input geometry r* = R.dot(r) is there functionality built into PySCF that would allow me to compute a matrix related to R that can be used to transform the original Fock F*, overlap S*, and molecular orbital coefficient matrix C* to be commensurate with newly rotated geometry?

https://github.com/pyscf/pyscf/blob/master/pyscf/symm/basis.py#L151  This function generates rotation matrix for each angular momentum given new axes. You can then transform the integrals with the generated D matrices.

Got this to work by constructing a block diagonal matrix based on the outputs from _ao_rotation_matrices as follows:
mats = _ao_rotation_matrices(mol, R)
mat_list = [mats[i] for i in mol._bas[:, 1]]
M = scipy.linalg.block_diag(*mat_list)

Then M can be used to transform, for example, the Fock matrix if the input geometry is rotated by R with: F' = M.T @ F @ M
Thanks all!


always keep changed/yanked-text marks, remove configuration

I don't see a reason why somebody ever should want to loose his '[ '] marks.
Since it is our plugin that removes the marks it should also always restore it. I think it is redundant to have that as a configurable option.

I agree


[React Storefront Kit]: Rename product and npm package

This PR:

Renames the Hydrogen UI product to React Storefront Kit
Renames the @shopify/hydrogen-react npm package to @shopify/storefront-kit-react
Partially fixes https://github.com/Shopify/shopify-dev/issues/28612
Relates to https://github.com/Shopify/shopify-dev/pull/29198, https://github.com/Shopify/hydrogen-ui/pull/98, and Custom Storefronts - Product Overview

Additional context
I've left references to Hydrogen UI in the changelog as-is, as they refer to a point in time when the product was still called Hydrogen UI, and the package was called @shopify/hydrogen-react.

Thanks! To be clear, I haven't actually renamed Hydrogen-UI and published the package yet, so this will probably have to wait for that work to happen first.

Thanks for taking a look at this, @frehner! Totally agree. It's just a bit of early work that I wanted to tuck in before the end of the year. We can co-ordinate in the new year on this one in terms of the right timing for publishing. ❤  It's here when we need it. 😄


Update cli-progress

Version 3.11.0 of cli-progress has a bugfix to support CI environments. https://github.com/npkgz/cli-progress/issues/117

I'm at Microsoft but don't have write access to this repo, so someone else will need to merge after review.

@BillyONeal @fearthecowboy for review and merge.

Thanks! (I merged despite the Windows failure because that is https://github.com/microsoft/vcpkg-tool/pull/542 )


bridgestan.R: fix a few doc typos and use consistent punctuation

Fixes a few doc typos and makes sure use of punctuation is consistent (sometimes punctuation was being used, other times not).

Let me update the couple files that are based on these comments real quick.
Thanks Jonah!

Looks good. Thanks, Jonah. Will merge when checks finish.

Thanks to you guys for making this! I’m finally playing around with it. Really cool.


[Proposal] "Cursor Hold" expect to trigger after some time without keypresses

I've included a comment a few days ago in #974 , but since that issue is closed, most likely it hadn't got any attention. Since it's a new proposal, I think it fits its own issue.
@junegunn Have you considered the possibility of binding a timeout after a certain length of time is passed without any keypresses, kind of like how CursorHold works in Vim?
Suppose something like:
fzf --expect=cursorhold --cursor-hold-timeout=500ms --require-input-before-cursor-hold ...

--expect=cursorhold would be triggered after a certain length of time passed.
--cursor-hold-timeout=500ms would specify that amount of time
--require-input-before-cursor-hold would assert the timeout would only happen after some key was pressed

With all of that, it would be possible to implement similar behavior to how interactive selectors work, while keeping fzf a simple filter tool.
Besides, it could also have other uses, such as allowing scripts with timeout "default" options to be built. Kind of like how multi-boot systems work. A screen that allows the user to interact and choose a option, but it he doesn't do anything, it will just pick the default option (note that, for this to work, the --require-input-before-cursor-hold wouldn't be used).

Any progress on this cursorhold feature?

I'd love to see this feature as well. I actually use fzf in a boot menu for ZFS, and I sorely missed this feature!
zfsbootmenu default timeout

Still hoping for this feature. Just changed one of my own scripts to use fzf instead of simply using read. Works perfectly fine except I used to be able to pass -t 60 to timeout after 60 seconds

Possible workaround: Event that is triggered after x seconds of idle time.
Example: Provided that the user has selected at least one item and more than 2 seconds have elapsed since the line was focused, all selected items will be printed to the terminal.
look foo | fzf \
  --listen \
  --multi \
  --preview-window 0 \
  --preview $'
    while kill -0 "$PPID"; do
      if ((FZF_SELECT_COUNT && SECONDS > 2)); then
        curl "localhost:$FZF_PORT" --data "become:cat {+f}"
      else
        sleep 0.05
      fi
    done'

term
description

--listen[^1]
Allows sending commands to fzf.

--preview-window 0
With 0, the window is not visible, but the command is still executed.

kill -0 "$PPID"
Checks if the parent process, in this case fzf, is still alive; true would work as well.

FZF_SELECT_COUNT[^2]
An exported environment variable from fzf indicating the number of selected items.

SECONDS
A parameter set by the shell (zsh, bash), indicating the number of seconds since shell invocation.

curl ...
Sends an update to fzf.

FZF_PORT[^3]
An exported environment variable from fzf for the port.

become:cat {+f}
An fzf action to print all selected items to the terminal.

{+f}
fzf placeholder for all selected lines (+) stored in a temporary file (f)

Fancy with 5s timer:
look foo | fzf \
  --listen \
  --multi \
  --preview-window 0 \
  --prompt "hello world ⧗ >" \
  --preview $'
    TMAX=5
    while kill -0 "$PPID"; do
      if ((FZF_SELECT_COUNT && SECONDS > TMAX)); then
        curl "localhost:$FZF_PORT" -d "become:cat {+f}"
      elif ((FZF_SELECT_COUNT)); then
        curl "localhost:$FZF_PORT" -d "change-prompt:${FZF_PROMPT%⧗*}⧗ $((TMAX - SECONDS))s > "
      else
        curl "localhost:$FZF_PORT" -d "change-prompt:${FZF_PROMPT%⧗*}⧗ > "
        sleep 0.2
      fi
    done'

[^1]: 0.36.0 CHANGELOG.md
[^2]: 0.46.0 CHANGELOG.md
[^3]: 0.39.0 CHANGELOG.md


Remove operatorgroup queueinformer

Description of the change:
An operatorgroup queueinformer was introduced in #2728.
The operatorgroup syncer was calling the syncResolvingNamespace
function, which expects a namespace object as an argument, with an
operatorgroup instead. This led to casting errors.
Since there is no need for an operatorgroup queueinformer, only a lister, the queueinformer can be removed entirely.
Motivation for the change:
Downstream bug
Reviewer Checklist

[ ] Implementation matches the proposed design, or proposal is updated to match implementation
[ ] Sufficient unit test coverage
[ ] Sufficient end-to-end test coverage
[ ] Docs updated or added to /doc
[ ] Commit messages sensible and descriptive
[ ] Tests marked as [FLAKE] are truly flaky
[ ] Tests that remove the [FLAKE] tag are no longer flaky

The commit message is a bit off eh? We should probably just mention that we no longer:

Use a queue informer.
Kickoff the syncNamespace function whenever we get an operatorGroup event.

Yeah I think it's probably overly-verbose. I will fix it up.

/approve

Fixed! Sorry about that.
/hold cancel

/lgtm


Shellxquote settings breaking things cryptically

I had an old shellxquote="" from way back when it was required to have such odd things for anything at all to work on windows, when dinosaurs roamed the earth.
It never caused issues and fixed some, so in my .vimrc it stayed, until today.
Today I decided to drop NeoBundle for Plug, and I was getting cryptic error messages when I attempted to run PlugUpdate to see if everything was working:

Turns out my shellxquote setting was causing it.
A quick look says that Windows defaults are sane now, so that's good at least.
Can you add a warning, or a faq item, or a workaround for that?

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled May 17 2017 21:37:07)
MS-Windows 64-bit console version
Included patches: 1-599
Compiled by hp@HP-PC
Huge version without GUI.  Features included (+) or not (-):
+acl             +ex_extra        -mouseshape      +tag_old_static
+arabic          +extra_search    +multi_byte      -tag_any_white
+autocmd         +farsi           +multi_lang      +tcl/dyn
-balloon_eval    +file_in_path    +mzscheme/dyn    +termguicolors
-browse          +find_in_path    -netbeans_intg   -tgetent
++builtin_terms  +float           +num64           -termresponse
+byte_offset     +folding         +packages        +textobjects
+channel         -footer          +path_extra      +timers
+cindent         +gettext/dyn     +perl/dyn        +title
+clientserver    -hangul_input    +persistent_undo -toolbar
+clipboard       +iconv/dyn       -postscript      +user_commands
+cmdline_compl   +insert_expand   +printer         +vertsplit
+cmdline_hist    +job             +profile         +virtualedit
+cmdline_info    +jumplist        +python/dyn      +visual
+comments        +keymap          +python3/dyn     +visualextra
+conceal         +lambda          +quickfix        +viminfo
+cryptv          +langmap         +reltime         +vreplace
+cscope          +libcall         +rightleft       +wildignore
+cursorbind      +linebreak       +ruby/dyn        +wildmenu
+cursorshape     +lispindent      +scrollbind      +windows
+dialog_con      +listcmds        +signs           +writebackup
+diff            +localmap        +smartindent     -xfontset
+digraphs        +lua/dyn         +startuptime     -xim
-dnd             +menu            +statusline      -xpm_w32
-ebcdic          +mksession       -sun_workshop    -xterm_save
+emacs_tags      +modify_fname    +syntax
+eval            +mouse           +tag_binary
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$HOME\vimfiles\vimrc"
 3rd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE  -DFEAT_JOB_CHANNEL      -DWINVER=0x0501 -D_WIN32_WINNT=0x0501  /Fo.\ObjCULYHTRZAMD64/ /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG  /MD -DFEAT_MBYTE -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python36.dll\" -DFEAT_MZSCHEME -I "C:\Users\hp\Desktop\racket-x64\include" -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracketxxxxxxx.dll\" -DDYNAMIC_MZGC_DLL=\"libmzgcxxxxxxx.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=24 -DDYNAMIC_RUBY_DLL=\"x64-msvcrt-ruby240.dll\" -DFEAT_HUGE /Fd.\ObjCULYHTRZAMD64/ /Zi
Linking: link /RELEASE /nologo /subsystem:console /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:AMD64   msvcrt.lib  user32.lib  /nodefaultlib:lua53.lib  /STACK:8388608  /nodefaultlib:python27.lib /nodefaultlib:python36.lib   "C:\TCL\lib\tclstub86.lib" WSock32.lib /PDB:vim.pdb -debug

Type:

[ ] Bug
[ ] Enhancement
[ ] Feature Request
[x] Question

OS:

[ ] All/Other
[ ] Linux
[ ] OS X
[x] Windows

Vim:

[x] Terminal Vim
[x] GVim
[ ] Neovim

Thanks for the heads up. I'll look into it when I get a chance.

Neovim has the same default value for shellxquote so it's not enough.

Neovim unsets shellxquote as well so it's not enough info.
Best to revert any Windows-specific shell options to their default values.


Revert "Always respond to triggers through react, so that the event loop is always involved"

Reverts potentialventures/cocotb#917
Just to check if this is really the cause of CI failure OF #928

Seems like Travis was just acting up when #917 was merged - I'm not able to reproduce the passing build any more.

I think we should go ahead and merge this reversion, and re-evaluate #917 against a non-broken travis


UCP: Search in TiKV slow log

Description
Now TiKV supports search in TiKV slow log. We also need to modify dashboard to support sending such requests. Notice that when exporting tar, tikv slow logs should be placed in a standalone file, instead of along with tikv normal logs.
Suggested implementation:

Add a field in log search task model, to store slow log.
Where sending requests to TiKV, send one extra request to retrieve slow log.
When packing as tar, handle the downloaded slow log separately.

Score

1680

Mentor(s)

@lonng
@breeswish

Contact the mentors: #tidb-challenge-program channel in TiDB Community  Slack Workspace
Recommended Skills

Golang

/pick-up-challenge

/pick-up-challenge

Resolved by #392


Develop a measure of hash quality for comparison

For < 64bit inputs hash quality is highly subjective, as any hash function that produces no collisions in the output is in some sense 'ok'. So to make the problem concrete, bit collisions in hash maps should be the focus. Some possible tests include:

Number of output bits flipped per bit of input
Low/high order collisions by incrementing by 1 or any other fixed constant.
Attacker flipping one or more mask bits and or rotating to 'undo' part of the scrambling.

Fixed https://github.com/tkaitchuck/aHash#hash-quality


documentation on attestation

Description
Adding documentation attestation. Not sure if we need Registering Metadata section.

I believe all the metadata commands will work with two simple changes:

use account rather than releasegold as the command, since you are just performing the account commands on the "releasegold account" or the signer. Examples celocli account:create-metadata ./metadata.json --from $RG_ATTESTATION_SIGNER
Use the ReleaseGold attestation signer address in the --from of these commands

Will confirm with @nambrot that using the signer address is correct for all of these commands, but I believe it should be

I see that attestation docs are now included in the getting started guide. Does this PR still need to be merged?

Closing this PR


[Auth] Implement resource ownership in code.

Patient identifier is checked agains jwt sub field so that only the user who represents that patient can use focusing with that patient.
Also some other roles might use focusing with other patients, for example, doctors.

Closing this issue as it's a duplicate of #3


Add KSCFloodlight

Closes https://github.com/KSP-CKAN/NetKAN/pull/2368

LGTM! Merging with Thanks! :D


Use progress notifications for install

Describe the feature
If the user has statusBarProvider set to "off" we should instead use progress notifications when a user is installing or updating metals.
Potential ways to implement
No response

So it turns out there is no real good way to do this. This wouldn't actually work for the initial install because there is no generic progress mechanism in Neovim, it's tied to LSP. Meaning that if you don't already have the client attached, there is no way to send a progress notification.


Login Selector for Kibana when multiple authentication providers are enabled

I'm trying to create a setup with local users (basicauth) and Oauth against Azure AD (openid). The configuration is working, yet when configuring/accessing the Kibana web interface it seems it is a "either one or the other" approach. Is that correct, or am I missing something?
It seems that with xpack this is possible by setting the value xpack.security.authc.selector.enabled: true according to this issue.
Is there a similar option within the opendistro_security plugin? Or will this option be available in the near future, or do you suggest another approach?

It seems like this is now fixed as of 2.4.0, but please re-open with more details if that is not the case.


Replace LightClient single_step JSON tests with MBT

closes #640

[ ] Referenced an issue explaining the need for the change
[ ] Updated all relevant documentation in docs
[ ] Updated all code comments where relevant
[ ] Wrote tests
[ ] Updated CHANGELOG.md

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@154a0eb). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff            @@
##             master    #641   +/-   ##
========================================
  Coverage          ?   42.7%
========================================
  Files             ?     167
  Lines             ?   11600
  Branches          ?    2593
========================================
  Hits              ?    4958
  Misses            ?    6352
  Partials          ?     290

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 154a0eb...4c515a5. Read the comment docs.

Besides clippy warnings, looks good from my side:) Thanks @Shivani912 for finishing this!

Also, could you point me at the changes in the TLA+ specs/models that accounts for the change in https://github.com/informalsystems/tendermint-rs/pull/657?

Also, could someone point me at the changes in the TLA+ specs/models that accounts for the change in #657?

@romac it is described in #659. We have disabled the tests that were checking this for now; will reenable them when the TLA+ model is updated.

Thanks!

@Shivani912 @andrey-kuprianov Great job!

Thanks @romac !

@romac thank you for reviewing the PRs so quickly:)


Support aarch64 EKS amis

Presently the AWS provider only supports x86_64 worker nodes - this issue is to add aarch64 support to the Provisioner.

What's in scope for this? Launching arm nodes? Running Karpenter as ARM? Helm charts?

Updated


renderSummaryRow callback is not working with remotedata

Describe the bug
https://material-table-core.com/demos/Summaryrow/basic/
the above example for showing summary row is not working if we set remotedata/ApI call for data prop
in case of remote data , the data coming to callback is empty array . we dont have any data to do aggregation on column values

Can you add a sandbox with your setup

I have the same issue in a more complex project, here is a simple sanbox to an basic example.
I debug for a while and I think that the summary rows dont wait for the remote data to render.
I really hope you can fix this.
Thanks!

Hi, @Domino987 any update on this, I really need it 😞

No not yet but you are welcome to open a PR to address this. I am not sure if I'll be able to fix this this week.

Can you try the latest version?

In the latest version it seems to be working fine. Thanks so much for your work @Domino987 😄


ARM NEON: Add support for Visual Studio ARM64 builds

Hi,
This attempts to add support for building Graphene with ARM NEON intrinsics for Visual Studio ARM64 builds, which is introduced with Visual Studio 2017 15.9.x.  This is done in a way like the previous work on the SSE intrinsics for Visual Studio, as there is no extension available that can alleviate us from using a static inline function when calling the ARM NEON intrinsics.
This involves:

Skip the checks for the presence of the ARM EABI macros and the ARM NEON macros, since those macros are done in a GCC-specific way and are not present (but it seems that Visual Studio offer the functionality that are demanded/offered by those macros).  The test code for ARM NEON intrinsics do compile as a result.  Check for _M_ARM64 in graphene-config.h.meson as well when checking to see GRAPHENE_HAS_ARM_NEON is activated.

Add (Re-word) the intrinsics for Visual Studio ARM64 builds in graphene-simd4f.h and graphene-simd4x4.h, so that GCCisms do not get in the way.  This comes at the cost of using static inline functions where needed, as that would be the best we could do, as when we added the SSE intrinsics for Visual Studio builds.  Also add comments for the SSE intrinsics sections so that this distinction between compiler syntax differences is made clearer.

Fix building graphene-ray.c, where we define isnanf() to _isnanf() and activate HAVE_ISNANF on 64-bit Windows.  Change this to check for _M_X64 (the Visual Studio macro defined for x64 builds) instead of _WIN64, since _isnanf() is provided on x64 builds only.

I was able to cross-compile Graphene for Windows 10 ARM with Visual Studio 2019 with ARM NEON intrinsics enabled, and have also built the code with Visual Studio 2019 on a Windows 10 ARM system and run the tests successfully, and the time taken seemed decent enough.
This does not attempt to cover introspection builds, as no official Python binaries exist for ARM64 Windows, so I was not able to build Graphene at this time with introspection support, but GLib/GObject are activated.
With blessings, thank you!

Thanks! This looks fantastic.


Cart total is not getting updated

Identified an issue with updating the cart, as the total cart amount is not being appropriately reflected despite receiving a success toast notification.
https://github.com/summit-webapp/summit/assets/123349027/f56b1364-30b4-404d-b15f-8bec87090986

@karan1633
Thank you for reporting this , we will fix it soon.


Entities' states do not update correctly after a disconnect/reconnect event

Hi,
I'm having an odd issue whereby the integration is occasionally disconnecting and reconnecting to the comelit mqtt broker.  This is what I see in the logs:
2024-10-28 04:23:05.253 INFO (Thread-3 (_thread_main)) [custom_components.comelit.hub] disconnected from hub
2024-10-28 04:23:05.253 INFO (Thread-3 (_thread_main)) [custom_components.comelit.hub] disconnected from hub
2024-10-28 04:23:10.247 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:23:11.338 INFO (Thread-3 (_thread_main)) [custom_components.comelit.hub] connected to comelit hub

Now, I don't exactly know why this is happening, but I imagine it's something specific to my config/hardware/network or something.
In any case, I think there must also be a bug in the integration itself, as after this reconnection happens, the states of my entities no longer get updated, as if the status requests were not getting received.
Here's a superset of the previous log, demonstrating the issue (I've also left in some logs from other integrations, demonstrating that my networking issues seem to be broader, and not in scope of this issue)
FYI, I modified the points at which the logging occurs slightly, you can see them in my fork https://github.com/optiluca/homeassistant-comelit
'TAPPARELLA BAGNO', 'sched_status': '0', 'status': '0', 'powerst': '0', 'position': '255', 'open_status': '0', 'preferPosition': '127', 'enablePreferPosition': '1', 'num_modulo': '14', 'num_uscita': '1', 'openTime': '18', 'closeTime': '18', 'icon_id': '0', 'isProtected': '0', 'objectId': 'DOM#BL#14.1', 'placeId': 'GEN#PL#74'}
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] update_cover: updating the cover DOM#BL#14.1 with state closed and position 100.000000
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#LT#22.1
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id GEN#PL#75
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#LT#22.2
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id GEN#PL#76
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#LT#20.1
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id GEN#PL#80
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#BL#11.1
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing cover TAPPARELLA RIPOSTIGLIO: {'id': 'DOM#BL#11.1', 'type': 2, 'sub_type': 31, 'descrizione': 'TAPPARELLA RIPOSTIGLIO', 'sched_status': '0', 'status': '0', 'powerst': '0', 'position': '255', 'open_status': '0', 'preferPosition': '127', 'enablePreferPosition': '1', 'num_modulo': '11', 'num_uscita': '1', 'openTime': '18', 'closeTime': '18', 'icon_id': '0', 'isProtected': '0', 'objectId': 'DOM#BL#11.1', 'placeId': 'GEN#PL#80'}
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] update_cover: updating the cover DOM#BL#11.1 with state closed and position 100.000000
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id GEN#PL#619
2024-10-28 04:22:00.264 DEBUG (Thread-3 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#LT#20.2
2024-10-28 04:22:02.099 ERROR (MainThread) [homeassistant.components.spotify.coordinator] Timeout fetching spotify data
2024-10-28 04:22:10.242 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:22:13.036 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=11209 Timeout after 4 seconds
2024-10-28 04:22:20.242 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:22:30.243 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:22:40.243 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:22:42.104 WARNING (SyncWorker_34) [urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=False, redirect=None, status=3)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fee20d86690>: Failed to establish a new connection: [Errno -3] Try again')': /v1/me/player?additional_types=episode
2024-10-28 04:22:46.311 ERROR (Thread#BS) [custom_components.comelit.vedo] Error getting data! Function post timed out after 10.0 seconds
2024-10-28 04:22:47.332 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception:
2024-10-28 04:22:50.021 ERROR (MainThread) [homeassistant.components.brother.coordinator] Timeout fetching brother data
2024-10-28 04:22:50.246 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:23:05.253 INFO (Thread-3 (_thread_main)) [custom_components.comelit.hub] disconnected from hub
2024-10-28 04:23:05.253 INFO (Thread-3 (_thread_main)) [custom_components.comelit.hub] disconnected from hub
2024-10-28 04:23:10.247 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:23:11.338 INFO (Thread-3 (_thread_main)) [custom_components.comelit.hub] connected to comelit hub
2024-10-28 04:23:20.248 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:23:30.248 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:23:40.249 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:23:50.249 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:24:00.250 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:24:10.250 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:24:20.251 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:24:30.251 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:24:40.252 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-10-28 04:24:50.252 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request

All status requests after the disconnection no longer result in the entity states actually being updated.
@gicamm does this make sense to you?  Is it an easy fix?  If not, I can try to have a look at some point.
Thanks,
Luca

I've had a look at it, I think the issue is that we need to rerun mqtt subscribe when we reconnect after a connection issue.  I've made the change in commit https://github.com/optiluca/homeassistant-comelit/commit/7722ae5a39d5fae793e3ab905561ea5c38e9ccac of my fork and will be running it for a few weeks, if it all seems OK I'll open a PR.

Hi Luca, that makes sense.
I'll try disconnecting the HUB manually and see what happens with and without your fix.

The fix seems to be working, this is a log form the last disconnect/reconnect now:

2024-11-03 04:38:53.091 ERROR (MainThread) [homeassistant.components.spotify.coordinator] Timeout fetching spotify data
2024-11-03 04:38:57.397 ERROR (MainThread) [homeassistant.components.roborock.coordinator] Error fetching roborock data: id=26561 Timeout after 4 seconds
2024-11-03 04:39:00.466 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-11-03 04:39:10.467 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-11-03 04:39:11.131 ERROR (Thread#BS) [custom_components.comelit.vedo] Error getting data! Function get timed out after 10.0 seconds
2024-11-03 04:39:20.468 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-11-03 04:39:27.237 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception:
2024-11-03 04:39:30.468 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-11-03 04:39:33.094 WARNING (SyncWorker_32) [urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=False, redirect=None, status=3)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbc8e466180>: Failed to establish a new connection: [Errno -3] Try again')': /v1/me/player?additional_types=episode
2024-11-03 04:39:37.243 ERROR (MainThread) [homeassistant.components.brother.coordinator] Timeout fetching brother data
2024-11-03 04:39:40.469 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-11-03 04:39:43.702 WARNING (SyncWorker_32) [urllib3.connectionpool] Retrying (Retry(total=1, connect=None, read=False, redirect=None, status=3)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbc80a64aa0>: Failed to establish a new connection: [Errno -3] Try again')': /v1/me/player?additional_types=episode
2024-11-03 04:39:47.368 ERROR (Thread#BS) [custom_components.comelit.vedo] Error getting data! None: Max retries exceeded with url: /login.cgi?_=1730605184250 (Caused by None)
2024-11-03 04:39:50.469 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-11-03 04:39:51.516 INFO (Thread-2 (_thread_main)) [custom_components.comelit.hub] disconnected from hub
2024-11-03 04:39:52.529 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] Announce. Agent id is 2
2024-11-03 04:39:54.910 WARNING (SyncWorker_32) [urllib3.connectionpool] Retrying (Retry(total=0, connect=None, read=False, redirect=None, status=3)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbc72749700>: Failed to establish a new connection: [Errno -3] Try again')': /v1/me/player?additional_types=episode
2024-11-03 04:40:00.469 DEBUG (Thread#1) [custom_components.comelit.hub] Publishing the status request
2024-11-03 04:40:00.491 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] Dispatching status
2024-11-03 04:40:00.491 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] processing item id GEN#PL#2
2024-11-03 04:40:00.491 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] processing item id GEN#PL#63
2024-11-03 04:40:00.491 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#LT#19.3
2024-11-03 04:40:00.492 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#LT#19.4
2024-11-03 04:40:00.492 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] processing item id DOM#BL#10.1
2024-11-03 04:40:00.492 DEBUG (Thread-2 (_thread_main)) [custom_components.comelit.hub] processing cover TAPPARELLA CUCINA: {'id': 'DOM#BL#10.1', 'type': 2, 'sub_type': 31, 'descrizione': 'TAPPARELLA CUCINA', 'sched_status': '0', 'status': '0', 'powerst': '0', 'position': '255', 'open_status': '0', 'preferPosition': '127', 'enablePreferPosition': '1', 'num_modulo': '10', 'num_uscita': '1', 'openTime': '36', 'closeTime': '36', 'icon_id': '0', 'isProtected': '0', 'objectId': 'DOM#BL#10.1', 'placeId': 'GEN#PL#63'}

I'll have a PR with you shortly.

Fixed with PR 103


Allow to clear default entries in collections in options

Description
As explained at https://github.com/dotnet/extensions/issues/1341, the configuration binder is unable to "see" empty collections in options. This poses a problem when the intent is to clear a collection instead of adding default entries. As a workaround, we allow a single-element empty string to indicate not to add defaults. For example, the following appsettings.json:
{
  "Management": {
    "Endpoints": {
      "Env": {
        "keysToSanitize": {
          ""
        }
      }
    }
  }
}

will overwrite the default of:
{
  "Management": {
    "Endpoints": {
      "Env": {
        "keysToSanitize": {
          "password",
          "secret",
          ...
        }
      }
    }
  }
}

This PR updates all cases where a collection is exposed in options that is non-empty by default.
Fixes #611.
Quality checklist

[x] Your code complies with our Coding Style.
[x] You've updated unit and/or integration tests for your change, where applicable.
[ ] You've updated documentation for your change, where applicable.
If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.
[x] There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
[ ] You've added required license files and/or file headers (explaining where the code came from with proper attribution), where code is copied from StackOverflow, a blog, or OSS.

/azp run Steeltoe.All


fix(cli): ios dev and ios build support for bun

I believe this may still be an issue. I changed the rust build phase of the Xcode project from bun tauri ios xcode-script -v --platform to cargo tauri ios xcode-script -v --platform to fix iOS builds. Unsure of the repercussions of this, but it's unblocked me.


Duplicate Imports Issue in Code Generation

While experimenting with the ktor-all-platforms-app example, I observed an anomaly during the code generation phase. Specifically, when extending the UserServiceClient class by adding a new function (hello2) that mirrors the functionality of an existing function (hello), the code generation process unexpectedly produces duplicate import statements for UserData. This occurs despite the logical expectation that both functions should share the same import statement for UserData, resulting in unnecessary redundancy and potential confusion.

Hi! Thanks for noticing
As we are currently moving from KSP to compiler plugins, this issue will be fixed by itself when were are done.

Fixed in #162


Feature/Tags

This PR adds a simple UI for a list of active tags.
It relys on https://hub.gdgx.io/api/v1/tags/active?callback=JSON_CALLBACK, blocked by https://github.com/gdg-x/hub/issues/76

Screenshots would be great :)

As the API is not yet available there is no UI/functionality
On 4 Dec 2015 4:19 am, "Michael Prentice"<EMAIL_ADDRESS>wrote:

Screenshots would be great :)
—
Reply to this email directly or view it on GitHub
https://github.com/gdg-x/firefly/pull/83#issuecomment-161861472.


How to update an image.

Hi,
Thank you for the great module !
My environment:

Windows 7
<EMAIL_ADDRESS>ostrio:files  1.9.6

I successfully inserted image; but i cannot update it.
Client.js
Template.Image.events({
'change #fileInput'(e, template) {
if (e.currentTarget.files && e.currentTarget.files[0]) {
	image = e.currentTarget.files[0];

		Meteor.call('updateImage',(image, error, result) =>{

				if(error){
					console.log(error.reason);

				}

				else {
					console.log("success");
				}

		});

}

}
});
server.js
'updateImage'(
image
){
				userIdProfile = imagesProfile.findOne({userId: Meteor.userId()}).userId;
				return imagesProfile.update(
					{
						userId: userIdProfile
					},
					{
						$set:
						{

							file: imageProfile,
							LastUpdate: new Date()
						}
					}
				)

},

Server logs:
W20180922-01:37:51.321(1)? (STDERR) (node:3492) UnhandledPromiseRejectionWarning
: Unhandled promise rejection (rejection id: 1): RangeError: Maximum call stack
size exceeded
W20180922-01:37:51.323(1)? (STDERR) (node:3492) [DEP0018] DeprecationWarning: Un
handled promise rejections are deprecated. In the future, promise rejections tha
t are not handled will terminate the Node.js process with a non-zero exit code.
Do you have a idea on how to solve it?

Hello @sir007 ,
Update is possible, but it will require extra coding.
We highly recommend to remove and upload/load/write/add a new image

Thanks @dr-dimitru
I'm still having some problems:
server.js
'updateImage'(
image
){
id = imagesProfile.findOne({userId: Meteor.userId()})._id;
images.remove({_id: id}, (error) => {
if (error) {
console.error(' failed to delete file, error:  ${error.reason}');
}
else {
console.info('File deleted');
fs.readFile(image, function (error, data) {
if (error) {
throw error;
} else {
imagesProfile.write(data, {
fileName: image,
userId: Meteor.userId(),
}, function (writeError, fileRef) {
if (writeError) {
throw writeError;
} else {
console.log(fileRef.name + ' is successfully saved to FS. _id: ' + fileRef._id);
}
});
}
});
					}
				});

}
Server logs:
Exception in callback of async function: TypeError: path must be a string or Buffer
I understand that the problem is the line:
"fs.readFile(image, function (error, data)"
image is the file submit by the client. Is it correct to use it as a buffer ?

@sir007
console.log(image);

Hi @dr-dimitru ,
are you very busy ?

@sir007

image is an object, to you know how to get the file's name of that object?

e.currentTarget.files[0].name

imagesProfile.remove({_id: id}) --------> only delete the doc; but does not delete the file in the FS . How to delete the doc and the file in FS ?

.remove() removes both record and file

@dr-dimitru,
on the browser console console.log(image.name) prints the name of the image uploaded;
on the server side, console.log(image.name)  prints undefined
I tried the following codes :
const util = require('util');
console.log(util.inspect(image, {showHidden: false, depth: null})); // prints an emty object
console.log(JSON.stringify(image, null, 4)); // prints an empty object
but:
console.log(image);  // prints (object, object)
I don't understand

@sir007 it's difficult to understand what you're trying to accomplish.

@dr-dimitru  sorry if my goal is difficult to understand.
I want to develop a feature that allows users to update their profile image.
You advised me to delete the old image and add the new image.
This the code used:
client.js
Template.ModifierImageProfile.events({
'change #fileInput'(e, template) {
if (e.currentTarget.files && e.currentTarget.files[0]) {
image = e.currentTarget.files[0];
Meteor.call('updateImage', image,(error, result) =>{
if(error){
alert(error.reason);
}
				else {
					alert("image updated");
				}

		});

}

}
});
server.js
'updateImage'(image){
			check (image, Object);
							try {
				if (!this.userId) {
					throw new Meteor.Error('405', 'Accès denied');
				}

				imageId = imagesProfile.findOne({userId: Meteor.userId()})._id;
				images.remove({_id: Id}, (error) => {
					if (error) {
						console.error('error while deleting file, error:  ${error.reason}');
					}
					else {
						console.info('file deleted');

						fs.readFile(image, function (error, data) {
						  if (error) {
							throw error;
						  } else {
							images.write(data, {
							  fileName: image.name,
							  userId: Meteor.userId(),
							}, function (writeError, fileRef) {
							  if (writeError) {
								throw writeError;
							  } else {
								console.log(fileRef.name + ' is successfully saved to FS. _id: ' + fileRef._id);
							  }
							});
						  }
						});

					}
				});
			}

			catch (exception) {
				throw new Meteor.Error('405', exception.message);
			}
},

});
The code can delete the old image ; but cannot add the new one.
I'm not sure that the server receives the image sent by the browser (using the method updateImage), because console.log (image.name) client side displays the name of the image but on the server side nothing is displayed.
I'm probably not on the right track or something is missing or wrongin the code.

@sir007 why you're using .write() method, while you should use .insert()?
That's scenario you should stick to:

User clicks Update (or click on input[type="file"])
Trigger click on input[type="file"]
User picks image to upload
Inside of change input[type="file"] event:

Trigger image.remove Meteor server method
Inside of image.remove Meteor method callback:

Pass image to FilesCollection#upload() method

@dr-dimitru,
let me try, i will let you know.

@dr-dimitru ,
i hope that is you are talking about :
client.js
Template.image.events({
'change #fileInput'(e, template) {
if (e.currentTarget.files && e.currentTarget.files[0]) {
	image = e.currentTarget.files[0];

	imageId = images.findOne({userId: Meteor.userId()})._id;
	images.remove({_id: imageId, userId: Meteor.userId() }, (error) => {
		if (error) {
			console.error(`File wasn't removed, error:  ${error.reason}`);
		} else {
			console.info('File successfully removed');

			Meteor.call('FilesCollection#upload', image,(error, result) =>{

				if(error){
					console.log(error.reason);
				}

				else {
					console.log("image updated");
				}

			});

		}
	});

}

}
});

i hope that is you are talking about :

No. Im telling you to use .insert() method

@dr-dimitru thank you for allowing me to move forward.
This is the new code:
client.js
Template.ModifierImageProfile.events({
'change #fileInput'(e, template) {
if (e.currentTarget.files && e.currentTarget.files[0]) {
	image = e.currentTarget.files[0];

	imageId = imagesProfile.findOne({userId: Meteor.userId()})._id;
	images.remove({_id: imageId, userId: Meteor.userId() }, (error) => {
		if (error) {
			console.error(`File wasn't removed, error:  ${error.reason}`);
		} else {
			console.info('File successfully removed');

			images.insert({
				file: image,
				onStart() {
				  template.currentFile.set(this);
				},
				onUploaded(error, fileObj) {
				  if (error) {
					alert('Error during upload: ' + error);
				  } else {
					alert('File "' + fileObj.name + '" successfully uploaded');
				  }
				  template.currentFile.set(false);
				},
				streams: 'dynamic',
				chunkSize: 'dynamic'
			});
		}

	});

}

}
});
collection.js
imagesProfile = new FilesCollection({
collectionName: 'imagesprofile',
storagePath: "C:/meteorapps/teledocta/public/imagesProfile",
allowClientCode: true, // allow remove files from Client
onBeforeUpload(file) {
// Allow upload files under 10MB, and only in png/jpg/jpeg formats
if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {
return true;
}
return 'Please upload image, with size equal or less than 10MB';
},
onBeforeRemove(cursor) {
const records = cursor.fetch();

if (records && records.length) {
  if (this.userId) {
	user = const user = this.user();
    //const user = this.user();
    // Assuming user.profile.docs is array
    // with file's records _id(s)

    for (let i = 0, len = records.length; i < len; i++) {
      const file = records[i];
      if (!~user.docs.indexOf(file._id)) {
        // Return false if at least one document
        // is not owned by current user
        return false;
      }
    }
  }
}

return true;

}
I have the following exception
Exception while invoking method '_FilesCollectionRemove_images' TypeError: Cannot read property 'indexOf' of undefined

Feels like it doesn't relative to lib, and you're experiencing issue in your own codebase.
Feel free to reopen it in case if the issue is still persists on your end.


Add several op mapping in PyTorch frontend

@kevinthesun @zhiics @masahi pls help take a look

So we simply ignore "inplace-ness" of copy_, is that right?
cc @t-vi I remember we had discussion of copy_ semantics before

@masahi we found copy_ exists in mask-rcnn model exported from https://github.com/facebookresearch/maskrcnn-benchmark, the mapping in this pr is good enough to support that and the test cases I prepared in this pr.
Have added a test cases class CopyInPlace(Module) to cover this inplace copy, we can pass the test cases, reason is the jit graph would not point to the original tensor after torch.Tensor.copy_.  For example, in the following code snippet,  to use a after copy_
a = torch.rand((2, 3))
b = torch.rand((2, ))
c = torch.Tensor.copy_(a, b)
return a # a is supposed to be original one, but in jit graph, it is the same as c

related graph:
 graph(%self : __torch__.___torch_mangle_10.CopyInPlace,
      %a : Float(2, 3, 5),
      %b : Float(2, 3, 5)):
  %3 : bool = prim::Constant[value=0]()
  %4 : Float(2, 3, 5) = aten::copy_(%a, %b, %3)
  return (%4)

yeah, that is also what happens with other inplace ops. TorchScript graph has distinct input/output tensors for each op, even though for inplace op output and one of input tensors point to the same memory.

yeah, that is also what happens with other inplace ops. TorchScript graph has distinct input/output tensors for each op, even though for inplace op output and one of input tensors point to the same memory.

I see. Interesting, it is more like a TorchScript issue then

Note that maskrcnn-benchmark isn't necessarily intended to be scripted, the worthwhile things have been incorporated into torchvision and improved there.
The trouble with in-place operators is that their semantics are not functional (i.e. they modify their inputs) and thus cannot be mapped to TVM. For example that when operated on views (e.g. slices of a tensor, things that come from view), they will change the origin (a[2:4] = b is a slice + a tensor modifying a).
What you would need to do is to preprocess the graph to remove these side-effects - for example if you can exclude that the input to clamp_ is a view (e.g. because it comes out of a convolution) and that it is not used anywhere else, you can replace it with clamp and proceed. It does require having an opinion on which tensors might share memory (the alias analysis in the PyTorch JIT does that).
The last discussion we had on this was #6049 .

What you would need to do is to preprocess the graph to remove these side-effects - for example if you can exclude that the input to clamp_ is a view (e.g. because it comes out of a convolution) and that it is not used anywhere else, you can replace it with clamp and proceed. It does require having an opinion on which tensors might share memory (the alias analysis in the PyTorch JIT does that).

Seems PyTorch already has a set of passes to remove mutation. For example, this pass looks like it removes inplace ops. https://github.com/pytorch/pytorch/blob/61623430d32c081124067fc4abf33bd4a023af90/torch/csrc/jit/passes/remove_inplace_ops.cpp#L35
Would be interesting to run torch._C._jit_pass_remove_inplace_ops(...) and see what happens

Would be interesting to run torch._C._jit_pass_remove_inplace_ops(...) and see what happens

the graph is still the same as before

Seems PyTorch already has a set of passes to remove mutation

Note fat warning at the top of the class, though.
A typical use of copy is something like this:
In [1]: import torch

In [2]: @torch.jit.script
   ...: def update(x, y):
   ...:     x[0] = y
   ...:     return x
   ...:

In [3]: update.graph
Out[3]:
graph(%x.1 : Tensor,
      %y.1 : Tensor):
  %7 : bool = prim::Constant[value=0]()
  %4 : int = prim::Constant[value=0]() # <ipython-input-2-e9bf1f9acfa9>:3:6
  %6 : Tensor = aten::select(%x.1, %4, %4) # <ipython-input-2-e9bf1f9acfa9>:3:4
  %8 : Tensor = aten::copy_(%6, %y.1, %7) # <ipython-input-2-e9bf1f9acfa9>:3:4
  return (%x.1)

the graph is still the same as before

Yeah, this pass only supports a very small subset of inplace ops, see
https://github.com/pytorch/pytorch/blob/61623430d32c081124067fc4abf33bd4a023af90/torch/csrc/jit/passes/remove_inplace_ops.cpp#L7-L12

Seems PyTorch already has a set of passes to remove mutation

Note fat warning at the top of the class, though.
A typical use of copy is something like this:
In [1]: import torch

In [2]: @torch.jit.script
   ...: def update(x, y):
   ...:     x[0] = y
   ...:     return x
   ...:

In [3]: update.graph
Out[3]:
graph(%x.1 : Tensor,
      %y.1 : Tensor):
  %7 : bool = prim::Constant[value=0]()
  %4 : int = prim::Constant[value=0]() # <ipython-input-2-e9bf1f9acfa9>:3:6
  %6 : Tensor = aten::select(%x.1, %4, %4) # <ipython-input-2-e9bf1f9acfa9>:3:4
  %8 : Tensor = aten::copy_(%6, %y.1, %7) # <ipython-input-2-e9bf1f9acfa9>:3:4
  return (%x.1)

just tested with a similar test case as the one you provided, the slicing assignment doesn't take effect in jit graph.
   ```
    # test case
    def forward(self, *args):
        a = args[0]
        b = args[1]
        a[0] = b
        return a
    ```

related graph:
graph(%self : __torch__.Copy,
      %a : Float(2, 3),
      %b : Float(1, 3)):
  %3 : int = prim::Constant[value=0]() # /Users/yongwu/Coding/tvm/tests/python/frontend/pytorch/test_forward.py:2400:0
  %4 : int = prim::Constant[value=0]() # /Users/yongwu/Coding/tvm/tests/python/frontend/pytorch/test_forward.py:2400:0
  %5 : Float(3) = aten::select(%a, %3, %4) # /Users/yongwu/Coding/tvm/tests/python/frontend/pytorch/test_forward.py:2400:0
  %6 : int = prim::Constant[value=3]() # /Users/yongwu/Coding/tvm/tests/python/frontend/pytorch/test_forward.py:2400:0
  %7 : int[] = prim::ListConstruct(%6)
  %8 : Float(3) = aten::view(%b, %7) # /Users/yongwu/Coding/tvm/tests/python/frontend/pytorch/test_forward.py:2400:0
  %9 : bool = prim::Constant[value=0]()
  %10 : Float(3) = aten::copy_(%5, %8, %9) # /Users/yongwu/Coding/tvm/tests/python/frontend/pytorch/test_forward.py:2400:0
  return (%a)

@yongwww what does "the slicing assignment doesn't take effect in jit" mean? The JITed function certainly does update a because select will return a view that uses the same memory as a and then copy_ writes to that.
Which thing in maskrcnn-benchmark produces the copy_ and why is your translation correct?

@t-vi  I see, thanks for pointing the select out, yeah, the jit graph is okay and works fine with PyTorch. But seems tvm doesn't support this case without real in-place operation. For a reference, we can see the slicing stuff here https://github.com/facebookresearch/maskrcnn-benchmark/blob/4ac0a3b440320ff0d0159a280f2897d1f9f996f3/maskrcnn_benchmark/modeling/box_coder.py#L85-L93

@masahi @t-vi @zhiics @kevinthesun
to sum up the discussion above. The mapping in this pr is able to support some test cases (added in the test_forward) which are not real in-place copy.
For test case @t-vi provided, the in-place copy is required, and the implementation in this pr doesn't work for that.
I would suggest adding a warning and todo in this mapping since some other merged in-place op mapping should has the similar issues, don't have a quick solution for this in my mind at this point. Any suggestion?

@yongwww to be clear, this translation works for box_coder from maskrcnn-benchmark you mentioned above? https://github.com/facebookresearch/maskrcnn-benchmark/blob/4ac0a3b440320ff0d0159a280f2897d1f9f996f3/maskrcnn_benchmark/modeling/box_coder.py#L85-L93 That looks similar to the test case @t-vi provided.
By "work", of course I mean we get the same output as pytorch would.

@masahi  the pr doesn't work for the code snippet in the box_coder I pointed, similar to that @t-vi provided.
After modifying the model definition script, we get copy_ removed. I am gonna remove copy_ from this pr, we could discuss inplace support in different thread.

@masahi  Just checked the op list under torch.Tensor, there are a bunch of inplace ops there, seems the op with suffix _ is inplace one, https://discuss.pytorch.org/t/how-to-identify-the-in-place-operation-in-pytorch/18592.

@masahi Just checked the op list under torch.Tensor, there are a bunch of inplace ops there, seems the op with suffix _ is inplace one, https://discuss.pytorch.org/t/how-to-identify-the-in-place-operation-in-pytorch/18592.

Yes, that is also my understanding. Removing and not supporting copy_ sounds good, as it is commonly used for a pattern we cannot support, but for other inplace ops like clamp_ and others already in the frontend, I think we can keep them. What do you think @t-vi ?

@masahi Just checked the op list under torch.Tensor, there are a bunch of inplace ops there, seems the op with suffix _ is inplace one, https://discuss.pytorch.org/t/how-to-identify-the-in-place-operation-in-pytorch/18592.

Yes, that is also my understanding. Removing and not supporting copy_ sounds good, as it is commonly used for a pattern we cannot support, but for other inplace ops like clamp_ and others already in the frontend, I think we can keep them. What do you think @t-vi ?

sounds good to me. A hacky way to detect the copy_ case is to use "select->view->copy_" as pattern, and return the vbut I it is on

Yeah, any op ending in  _ will be inplace and there are many.
Without keeping track of memory locations some construct to represent copy_ we likely cannot faithfully represent all possible uses of inplace ops.
So without a pure way, we have to balance the two

With inplace, we will take in idioms we cannot support if we do so without further analysis. (Because the example would also apply to clamp_, as seen below.)
Without things like relu_, we might exclude many networks (inplace relu_ after something where the output isn't needed for the backward is quite popular) that would otherwise run fine.

This appears also to be the rationale for the ad-hoc inplace removal for ONNX export, and I'm sure the PyTorch-ONNX people had a good think (and they have more alias analysis available to them) if there are better options. So I guess whatever they let go through by just assuming inplace can be made out-of-place might also be desirable to treat this way here. Maybe the list they use is a good guide.
I would imagine that someone somewhere does things like
def pn_relu(x):
   x[0].clamp_(min=0)
   x[1].clamp_(max=0)

(so the nonzero bits would be normally distributed for normally distributed inputs to be clever about exploding/vanishing activations), but I don't think it's terribly popular, so I would not worry about it.
For maskrcnn-benchmark in particular, I did a bit of tracing almost two years ago when I experimented with my  PyTorch POC port to Android (but the tracing PR was never merged) and should be easy to remove their inplace use. But it would seem that it's more useful to focus on the TorchVision implementations, maskrcnn-benchmark is really dormant and my impression was that it itself wasn't fixed much but instead the lessons learned from there have flown into TorchVision and people have worked on JIT/ONNX/Quantization properties there.

@masahi @t-vi seems the translation for every inplace op has similar issue as copy_, considering the translation works for some cases (those w/o real inplace), I would like to still keep copy_ and clamp_ in this pr, and add warning for all implace op. How do you think? getting more model supported is the first step for us, if overall inference result is not correct, then one of the first things is to look at the implace op mapping warning, does this make sense to you?

Is there a valid usage of copy_ that we can (and you want to) support? From the discussion so far, I was under impression that copy_ is always generated from an idiom that requires true inplace support.

Is there a valid usage of copy_ that we can (and you want to) support? From the discussion so far, I was under impression that copy_ is always generated from an idiom that requires true inplace support.

For example, the copy_ translation works for the test cases I provided in test_forward.py. But the case from t_vi is more common for which the translation doesn't work.

 Nobody writes torch.copy_() explicitly right?

 Nobody writes torch.copy_() explicitly right?

I won't write model using torch.copy_(). seems copy_ happened in the similar cases to that t-vi provided in real world application. Does keeping clamp_ and removing copy_ sound good to you? I am okay to remove any one of them

Yes, I think we can keep clamp_, but copy_ seems to require true inplace always, so we shouldn't support it (even if we add a conversion of copy_, the output from TVM would be wrong, so it is better not to support it).

Yes, I think we can keep clamp_, but copy_ seems to require true inplace always, so we shouldn't support it (even if we add a conversion of copy_, the output from TVM would be wrong, so it is better not to support it).

makes sense to me. Thanks, will do that.

I also want to take some time studying how PyTorch ONNX export handles inplace ops, and whether we can reuse some of their passes.

Thanks @yongwww  @t-vi


CRTM compile problem when building from tag v5.25.2

I accidentally deleted part of a prior build with v5.25.0 so figured I should just delete it all and start again with the newer v5.25.2 release.  When executing the parallel_build I ran into a problem compiling the NCEP CRTM
catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
compilation aborted for<EMAIL_ADDRESS>(code 1)
make[2]: ***<EMAIL_ADDRESS>Error 1
make[1]: ***<EMAIL_ADDRESS>Error 2

I checked out the v5.25.0 tag again to try that, and there was no problem in compiling the CRTM.

Yeah. This has actually be here since the CVS days. It's a bug to do with Intel 18+ and ADA_Module.F90. The worst thing is that if you recloned 5.25.2 it'll build for you. It's an occasional error that can be solved by:

Change the optimization level of that file to -O0, -O1, or -O3. Anything but -O2.
Perhaps (per @aoloso), add -no-vec to the file's options helps it work.
Change TMPDIR in your environment
Build on a different node

All of these can help build it.
The first one is guaranteed to let you build, but it will most likely be non-zero-diff.
The second one is a new one that I've heard helps, but again, might be non-zero-diff. And to test it, I need to trigger the ADA_Module problem (I rarely hit it).
The third and fourth don't change the compilation level, but they do not always work, so they are rather bad workarounds, but they can help in a pinch.
Thus, this means we have an issue that (truly) only @rtodling or others in GEOSadas land can help solve. Any permanent fix will probably mean a non-zero-diff change to a code I have no idea how to test.

I was having no luck with my TMPDIR set to something on dnb31 (same as my NOBACKUP) but when I set to a directory on dnb04 it compiled.  Weird.  I wonder if there is something to do with quota because I've occasionally been having issues with too many files in my $NOBACKUP.  Then again maybe not.  It's a mystery.

And it is back. I've just this multiple times now with versions geos/v1.0.5 using intel <IP_ADDRESS>4 with the debug build. I did confirm the debugging flags were still being passed when choosing the DEBUG build type in cmake.

As reported by @bena-nasa, this is still with us. Testing shows that -check all,noarg_temp_created seems to be the culprit in our Intel Debug flags. If we do something a la FMS:
# This 'resets' the Intel DEBUG flags for FMS. The stock debug flags use
# 'all,noarg_temp_created' which seem to be too aggressive for FMS/MOM6. This
# moves them back to the 'bounds,uninit' GEOS used to build with.
if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" AND CMAKE_BUILD_TYPE MATCHES Debug)
   string(REPLACE "all,noarg_temp_created" "bounds,uninit" _tmp "${GEOS_Fortran_FLAGS_DEBUG}")
   set (CMAKE_Fortran_FLAGS_DEBUG "${_tmp}")
endif ()

I think it would work around it.


Replace changelog subgraph with on chain listener

We should try to get rid of the changelog subgraph and replace it with an on chain listener

resolved by #80


Colab notebook does not seem to work.

As best I can tell, the Google Colab script in the README is no longer functional. Attempting to run it results in the following error message:
Traceback (most recent call last):
  File "marllib_script.py", line 2, in <module>
    from marllib import marl
  File "/usr/local/lib/python3.8/site-packages/marllib/marl/__init__.py", line 25, in <module>
    from marllib.marl.algos import run_il, run_vd, run_cc
  File "/usr/local/lib/python3.8/site-packages/marllib/marl/algos/__init__.py", line 23, in <module>
    from .run_cc import run_cc
  File "/usr/local/lib/python3.8/site-packages/marllib/marl/algos/run_cc.py", line 25, in <module>
    from ray.rllib.utils.framework import try_import_tf, try_import_torch
  File "/usr/local/lib/python3.8/site-packages/ray/rllib/__init__.py", line 7, in <module>
    from ray.rllib.env.base_env import BaseEnv
  File "/usr/local/lib/python3.8/site-packages/ray/rllib/env/__init__.py", line 1, in <module>
    from ray.rllib.env.base_env import BaseEnv
  File "/usr/local/lib/python3.8/site-packages/ray/rllib/env/base_env.py", line 4, in <module>
    import gymnasium as gym
  File "/usr/local/lib/python3.8/site-packages/gymnasium/__init__.py", line 4, in <module>
    from gymnasium.core import (
  File "/usr/local/lib/python3.8/site-packages/gymnasium/core.py", line 9, in <module>
    from gymnasium import spaces
  File "/usr/local/lib/python3.8/site-packages/gymnasium/spaces/__init__.py", line 13, in <module>
    from gymnasium.spaces.box import Box
  File "/usr/local/lib/python3.8/site-packages/gymnasium/spaces/box.py", line 7, in <module>
    from numpy.typing import NDArray
ImportError: cannot import name 'NDArray' from 'numpy.typing' (/usr/local/lib/python3.8/site-packages/numpy/typing/__init__.py)

Additionally, the setup script, also in the README, seems to be missing a few compatibility adjustments, though they may be specific to the machine I was running MARLlib on. In case it's of use, here's the process I went through to get it to work:
conda create -n marllib python=3.8
conda activate marllib
git clone https://github.com/Replicable-MARL/MARLlib.git && cd MARLlib
pip install --upgrade pip setuptools==65.5.0 wheel==0.38.4
pip install -r requirements.txt
pip install protobuf==3.20.3
cd ./marllib/patch
python add_patch.py -y
cd ...

@MatthewCWeston I have resolved this bug, which was caused by numpy version.


[Feature request] Plugin for Albert (another quick launcher)

Hi!
I would like to know if there's any chance of making this amazing plugin available for Albert. Since both programs use third party plugins based o python I wondered if you can make a "port" for albert. I would do it myself but I'm not a programmer. So I asked, if it's posible, for your help.
Thanks in advance.

I currently not, because I am not using Albert. But the calculate everything extensions is available for Albert and Obsidian, so one could use their repository as a guide on how to support both systems https://github.com/tchar/ulauncher-albert-calculate-anything.

I see. Thanks anyway! I hope someone can make a port to albert someday :smile:


Transitioning to a different nested state via event?

Is it possible from A.one to have an event transition to B.two?
  const machine = Machine({
    initial: 'A',
    states: {
      'A': {
        initial: 'one',
        states: {
          'one': {
            on: {
              GO_B: '#B',
              GO_B_TWO: '#B.two'
            }
          }
        },
      },
      'B': {
        id: 'B',
        initial: 'two',
        states: {
          'two': {}
        },
      },
    }
  })

let nextState = machine.transition(machine.initialState, 'GO_B') works.
let nextState = machine.transition(machine.initialState, 'GO_B_TWO') errors with Substate '#B.two' does not exist on '(machine).A.one'.

I guess it will work if 'B.two' is assigned a specific id of B.two. Is that the only way to do it?

I guess it will work if 'B.two' is assigned a specific id of B.two. Is that the only way to do it?

Yes, the ID must either be the absolute ID (no mixing #B + .two, for example) or a relative ID.
This lends itself to best practices - if you want to "escape" the parent state node, it's sometimes better to propagate the event up to the parent and let the parent decide what to do.
However, I'm going to make some fixes to in: ... syntax for transitions to allow for IDs (this issue: #151)


Pre-validations

Hi,
Is there any way to add validations before the plugin's validations take place? I have a couple of fields that I initialize as not required, but if the user selects certain option, I have to make that field(s) required. Is there any way to achieve this with the current implementation of the plugin? If not, is there any way that I can prevent the plugin submit and do some validations of my own before triggering the plugin's submit?

Sorry IMO this is outside the scope of this plugin.


Clean and docs

Clean up TypeScript code, including removing as many tslint warnings as possible.
Document things in README.

I kept this as two different commits since people may not want the cleanup.

LGTM

Incorporated feedback.


landscape.io: improvements

landscape.io: improved code health by removing some errors and code smells.

Coverage decreased (-0.08%) to 56.155% when pulling 3cc0cc3ed418cdd6a15ea6ae2d65ed1ec52cedf8 on steenzout:landscape_io into e1c5f3caa430c5d7842d767aaf7bf9abfa366627 on Storj:develop.

Coverage decreased (-0.08%) to 56.155% when pulling 3cc0cc3ed418cdd6a15ea6ae2d65ed1ec52cedf8 on steenzout:landscape_io into e1c5f3caa430c5d7842d767aaf7bf9abfa366627 on Storj:develop.


mi/2625/rafiki docs ia

Changes proposed in this pull request

Context

Checklist

[ ] Related issues linked using fixes #number
[ ] Tests added/updated
[ ] Documentation added
[ ] Make sure that all checks pass
[ ] Bruno collection updated

This is not very easy to review. Is there a google doc we can look at?

I copied the outline from a working document authored by Melissa.  Hope this is easier to view:
https://docs.google.com/document/d/1JkZS-Ih6MGdlG5oj3xSBFoAOA0_yBBEvPWZft526mKc/edit?usp=sharing

@hajjimo do we want to close this until we are ready to publish the new sections? In the meantime we can just use the google doc?

@mkurapov makes sense since the writers are working in Google Docs and we plan to create a new branch when it's time to move to markdown anyway.