[fpga] cascaded bufgce

I'm doing some experiments with the clock manager and integrating it into top_earlgrey.
One of the issues that's popping up right now is cascaded clock gating between the clkmgr and  local ibex gating, and this makes fpga unhappy.
Do you guys have a preferred way of solving this? For example do you prefer the clock fed into ibex be completely ungated and ibex will just handle it locally? I tend to prefer some kind of hierarchical clock gating, but it can be argued in this case there is not a huge benefit.
Part of the reason for wanting the hierarchical clock gating from my perspective is that it makes it easier for the power manager to handle "sleep fall through" cases where the WFI is is nulled by an interrupt that arrived at the right time when the hw is trying to put the chip down.  This of course can still be done without hierarchical gating, but it's typically a little more "racey".
Of course, I can also set an fpga rule to just allow this cascade, let me know what you guys think.

I underscoped the issue earlier.. vivado is actually flagging every BUFGCE introduced by clkmgr.  This is because inside clkgen there are two root BUFGs already, and that causes a ton of cascaded BUFG, in addition to the specific ibex case where there are 3.
So the original question still stands.  There is now a second follow-on on question on whether it's okay to remove the BUFG from clkgen, since downstream there are already many of them.  It seems like it would be safe to make this a parameter or define option? Let me know what you think.

Does the FPGA build still work and meet timing with the clock gates? From a quick read of some Xilinx documentation we might have a lot of clock skew issues with cascaded clock gates / BUFGCEs.
I think in general the hierarchical clock gating is a good idea - we could just replace all clock gating cells for FPGA builds.

sorry let me clarify a bit. The prim_clock_gating cells are already utilizing @imphil's abstract construct. So for RTL, it is a latch and AND gate, and for fpga they are currently BUFGCE cells.
Originally, the path of the clock gate looks like this..
clkgen/BUFG -> consuming ips
clkgen/BUFG -> ibex/BUFG -> ibex_core

When i added the first version of clkmgr with lots of hierarchical gating, it looked like this.
The tool was VERY unhappy
clkgen/BUFG -> clkmgr/root/BUFGCE -> clkmgr/leaf/BUFGCE -> consuming ips
clkgen/BUFG -> clkmgr/root/BUFGCE -> ibex/BUFG -> ibex_core

I've since removed the hierarchical gating for most things, as well as the clkgen/BUFG, so now it looks like this
clkgen -> clkmgr/leaf/BUFGCE -> consuming ips
clkgen -> clkmgr/root/BUFGCE -> ibex/BUFG -> ibex_core

This last version seems to make the tool happy for the consuming ips, I need to double check ibex one more time.
I'm mainly asking 2 things now

Is it okay to remove clkgen/BUFG in favor of the clkmgr ones?
Do we prefer to remove clkmgr/root/BUFGCE upstream of ibex? Or should I remove that too?

sorry final update.
It seems as long as I remove the BUFG from clkgen, everything else is okay.  Assuming clkmgr doesn't use hierarchical gating, then most blocks only have 1 level of BUFG.  The only 2 level is from clkmgr to ibex, and that seems to be placeable for the tool without causing a lot of timing issues.
Let me know if this is an acceptable fix.  I will break out a separate PR and make the clkgen buffers optional.

I was more thinking that the prim_clock_gating cells could be replaced with a straight pass-through, rather than inferring a BUFGCE cell. That leaves all the clocks running all the time, but I think that's the normal thing to do when stuffing an ASIC design into an FPGA.
If we can get away without doing that, by removing the clkgen BUFGs, then that sounds good to me. Not sure about the Ibex one, but might as well leave it in for now if the FPGA build is happy?

To be honest, having the CGs be passthrough instead of using BUFGCE is also
what I am used to.
I'd be fine with doing that here also, but I didn't know if there was a
specific reason they were BUFGCEs to start with.
On Thu, Apr 30, 2020 at 1:03 AM Tom Roberts<EMAIL_ADDRESS>wrote:

I was more thinking that the prim_clock_gating cells could be replaced
with a straight pass-through, rather than inferring a BUFGCE cell. That
leaves all the clocks running all the time, but I think that's the normal
thing to do when stuffing an ASIC design into an FPGA.
If we can get away without doing that, by removing the clkgen BUFGs, then
that sounds good to me. Not sure about the Ibex one, but might as well
leave it in for now if the FPGA build is happy?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/lowRISC/opentitan/issues/2086#issuecomment-621680220,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAH2RSTDJC4KIXNFEXL25BDRPEWFTANCNFSM4MTL53RA
.


Feature Request: Append to scratchpad with dynamic prefix (date and time)

Feature Requested
As it seems, the scratchpad prefix supports static strings only.
It would be very useful to add date and time as a prefix for instance

03/12/2023 16:30:57 - some scratchpad text

Relevant Screenshot
No response
Checklist

[X] The feature would be useful to more users than just me.
[X] I have checked the feature overview and the feature doesn't already exist.
[X] Feature Requests regarding daily notes will not be implemented, since there are other Alfred workflows that do focus on daily notes already.
[X] If it is an entirely new feature: The requested feature makes more sense to be implemented in Alfred than in a plugin. Please also explain why.

+1

The scratchpad actually already supports that feature: You can use Alfred's Dynamic placeholders to add things like a date, for example via {date}.
Only thing is, that this feature is actually not documented anywhere 🙈
I added some pointers in the readme and the workflow configuration to make it clearer that Alfred's placeholders are supported.

Only request for this, can we use the {query} command without having it double up? This way we can put the date at the end :)

That's not supported, and unfortunately also a bit too niche in my view. In think for your needs, creating your own custom workflow for adding to files would be a much better fit for your needs.


Relative file links in .pdf - how to enable them?

Hello, I have a little problem:
most links in my .doc file are in relevant format like:
/folder1/folder2/image.jpg
/folder1/folder2/image2.jpg
etc..
Which in pdf is converted to file:///folder1/folder2/image.jpg etc.
and they do not open in pdf.js viewer
Is it possible to automatically change such links to:
https://mydomain.com/folder1/folder2/image.jpg
Thanks for help.

most links in my .doc file are in relevant format like

Note that the PDF.js library only support .pdf files, and not any other file type.

Is it possible to automatically change such links to:
https://mydomain.com/folder1/folder2/image.jpg

Yes, if you provide the docBaseUrl option when calling getDocument; please see https://github.com/mozilla/pdf.js/blob/2cf90cd9adbdc14c175c99e0699f371c1d92fc31/src/display/api.js#L149-L151

For future reference: When opening an issue, please remember to provide all of the information requested in https://github.com/mozilla/pdf.js/blob/master/.github/ISSUE_TEMPLATE.md

most links in my .doc file are in relevant format like

Note that the PDF.js library only support .pdf files, and not any other file type.

Is it possible to automatically change such links to:
https://mydomain.com/folder1/folder2/image.jpg

Yes, if you provide the docBaseUrl option when calling getDocument; please see
https://github.com/mozilla/pdf.js/blob/2cf90cd9adbdc14c175c99e0699f371c1d92fc31/src/display/api.js#L149-L151
For future reference: When opening an issue, please remember to provide all of the information requested in https://github.com/mozilla/pdf.js/blob/master/.github/ISSUE_TEMPLATE.md

Thanks, it works! :D


CTRL+W should not close vscode

It takes me completely by surprise every time I close a few windows with CTRL+W and then decide to just close them all by keeping it held down and then discovering that vscode closes as well.  This is just plain wrong - no app that I know of, other than browser, which are just a collection of tabs, does this.
Yes, I know you can unbind it (but that's not actually obvious since it seems like it would be the same action that's happening, so I think most people would not look for this).

You can do it by delete this shortcut

Yes, but read my comments.  This really should not be the default.


fix(behavior_velocity_planner): fix getNearestLaneId()

Signed-off-by: Fumiya Watanabe<EMAIL_ADDRESS>Description
Before this change, if the ego vehicle runs out from the lane, the behavior planning module is re-launched.
To fix this behavior, I fixed the logic to get nearest lane id as following:

Find nearest lane id from lane ids included in the original path

Related links

Tests performed
Tested in planning_simulator
https://user-images.githubusercontent.com/10190493/183883367-b35c42b0-5b4c-4d25-b024-bf84c955fa5f.mp4

Notes for reviewers

Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.

[x] I've confirmed the contribution guidelines.
[x] The PR follows the pull request guidelines.

In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.

[ ] The PR follows the pull request guidelines.
[ ] The PR has been properly tested.
[ ] The PR has been reviewed by the code owners.

Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.

[ ] There are no open discussions or they are tracked via tickets.
[ ] The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

Close this PR because this change is included in https://github.com/autowarefoundation/autoware.universe/pull/1594


fix license, fixes #35

Checklist

[x] Used a personal fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged)
[x] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

@conda-forge-admin, please rerender

Should just add yourself as maintainer in this PR.  Not sure what the bot's deal is.

let me ask on gitter if the bot is having problems, they can look


[WIP] Add neural DAE support

@ChrisRackauckas @Vaibhavdixit02

This would need a test to build on, @ChrisRackauckas can you point me to an example how that should like?

A mass matrix one would be more useful, but this also is just incorrect. How does one specify the constraint equations? The algebraic variables?
For a test DAE, use something non-stiff. The ROBER equations for a short time are.
function f(out,du,u,p,t)
  out[1] = - 0.04u[1]              + 1e4*u[2]*u[3] - du[1]
  out[2] = + 0.04u[1] - 3e7*u[2]^2 - 1e4*u[2]*u[3] - du[2]
  out[3] = u[1] + u[2] + u[3] - 1.0
end

u₀ = [1.0, 0, 0]
du₀ = [-0.04, 0.04, 0.0]
tspan = (0.0,10.0)

using OrdinaryDiffEq
differential_vars = [true,true,false]
prob = DAEProblem(f,du₀,u₀,tspan,differential_vars=differential_vars)
sol = solve(prob,DABDF2())

which should be differentiable with Tracker.


Autoformat files on save when running them causes lines addition to code

Editor replicates lines of code at end of script
I have already written about this on stackoverflow (https://stackoverflow.com/questions/68472061/spyder-suddenly-copies-code-to-end-of-file), but at the time I could not reproduce the bug. Here is what I know today with an example to reproduce everything.
With certain script constellations, the last couple of lines of a script are replicated at the end of the script without user intervention when pressing F-5 (Run script). This can lead to a lot of time lost, e.g. when the main function is replicated at the end of a script.
Steps to Reproduce the Problem

Copy the following script to the spyder editor. Note that the code is not yet formatted and there are a couple of long lines towards then end.

# -*- coding: utf-8 -*-
"""
Created on Wed Aug 25 15:19:45 2021

@author: tobia
"""

import statistics
from edatest import Edatest

def get_quartiles(l, method):

    l = sorted(l)
    q0, q4 = min(l), max(l)
    q2 = statistics.median(l)
    if method == "MS":
        p1 = int((len(l) + 1) / 4 + 0.5)
        q1 = l[p1 - 1]
        p1 = int(3 * (len(l) + 1) / 4) - 1
        q3 = l[p1]
    else:
        len_odd = len(l) % 2 == 1
        mid_point = len(l) // 2

        left = l[0:mid_point]
        if len_odd:
            right = l[mid_point + 1 :]
        else:
            right = l[mid_point:]

        if (method == "T") and (len(l) % 2 == 1):  # odd number of elements
            left.append(q2)
            right = [q2] + right

        # print(f"left: {left}, right: {right}")
        q1 = statistics.median(left)
        q3 = statistics.median(right)

    return [q0, q1, q2, q3, q4]

if __name__ == "__main__":
    Test = Edatest()
    Test.assert_equals(get_quartiles([4, 1, 7, 8, 3, 6, 5, 2], "T"), [1, 2.5, 4.5, 6.5, 8])
    Test.assert_equals(get_quartiles([4, 1, 7, 8, 3, 6, 5, 2], "MS"), [1, 2, 4.5, 7, 8])
    Test.assert_equals(get_quartiles([2, 6, 1, 8, 5, 9, 7, 4, 3], "MM"), [1, 2.5, 5, 7.5, 9])
    Test.assert_equals(
    get_quartiles([2, 6, 1, 8, 5, 9, 7, 4, 3], "MS"), [1, 3, 5, 7, 9]
    )
    Test.assert_equals(get_quartiles([10, 3, 1, 8, 6, 4, 7, 5, 2, 9], "T"), [1, 3, 5.5, 8, 10])
    Test.assert_equals(get_quartiles([10, 3, 1, 8, 6, 4, 7, 5, 2, 9], "MM"), [1, 3, 5.5, 8, 10])
    Test.assert_equals(get_quartiles([10, 3, 1, 8, 6, 4, 7, 5, 2, 9], "MS"), [1, 3, 5.5, 8, 10])
    Test.assert_equals(get_quartiles([3, 9, 11, 2, 4, 1, 8, 6, 10, 5, 7], "T"), [1, 3.5, 6, 8.5, 11])
    Test.assert_equals(get_quartiles([3, 9, 11, 2, 4, 1, 8, 6, 10, 5, 7], "MM"), [1, 3, 6, 9, 11])

Press F-5 -> the script is saved, formatted and executed
Press F-5 again: the script is again executed and terminates with an error message

File "C:\Users\tobia\OneDrive\Documents\Python Scripts\edabit\quartiles\quartiles.py", line 63
    )
    ^
SyntaxError: unmatched ')'

because someone added a couple of lines to the end of the script. In this case it is the following lines:
        get_quartiles([10, 3, 1, 8, 6, 4, 7, 5, 2, 9], "T"), [1, 3, 5.5, 8, 10]
    )
    Test.assert_equals(
        get_quartiles([10, 3, 1, 8, 6, 4, 7, 5, 2, 9], "MM"), [1, 3, 5.5, 8, 10]
    )
    Test.assert_equals(
        get_quartiles([10, 3, 1, 8, 6, 4, 7, 5, 2, 9], "MS"), [1, 3, 5.5, 8, 10]
    )
    Test.assert_equals(
        get_quartiles([3, 9, 11, 2, 4, 1, 8, 6, 10, 5, 7], "T"), [1, 3.5, 6, 8.5, 11]
    )
    Test.assert_equals(
        get_quartiles([3, 9, 11, 2, 4, 1, 8, 6, 10, 5, 7], "MM"), [1, 3, 6, 9, 11]
    )

which are the ~15 last lines of the script, which were just copied to the end.
4. You can go back by pressing Ctrl-Z twice, and try again from there.
It is interesting to note that one can observe this behaviour in real-time when watching the scroll bar at the right side of the window. Its size changes twice, presumably the first time when the code is reformatted, and then again, when the last couple of lines are replicated.
Versions
Spyder version: 5.0.5
Python 3.8.10 64-bit | Qt 5.9.7 | PyQt5 5.9.2 | Windows 10
I have observed this behaviour also in previous versions of spyder, but could only reproduce it now.
Dependencies
For the script above to run edatest needs to be installed (https://pypi.org/project/edatest/), however this is not central to the bug, only required to run the script.

Hi all. I'm having the same problem, but I'm not using OneDrive, and it's specifically when I format using Black.
Steps to recreate:

Create a python file with anything in it, e.g.

if __name__ == "__main__":
    print("Hello World")

Save the file locally e.g. C:\Users<user>\Desktop
In Preferences --> Code style and formatting, change the code formatting provider to black.
Run black on the file via the drop-down menu or CTRL+ALT+I.
Observe file contents as:

if __name__ == "__main__":
    print("Hello World")
)

The amount of copied text seems to depend on the size of the file. e.g.:
def useless_function():
    pass

if __name__ == "__main__":
    print("Hello World")

becomes:
def useless_function():
    pass

if __name__ == "__main__":
    print("Hello World")
rld")

This content recreation doesn't occur when I use black through a console (i.e. not using Spyder) or if I use autopep8 instead of black as the

Hi @divingtobi I was able to reproduce this and as you say without having the file synced with any service :+1:
Thanks for the reproducible example !

Pinging @ccordoba12 and @andfoy just in case (maybe they know better what could be happening)

@ahurlbatt, your bug seems like a duplicate of #16180 and it'll be fixed in our next version (5.1.2), to be released shortly.
This bug only happens when you run an unsaved file and auto-formatting on save is activated.

@ccordoba12 Unfortunately not. I have auto-formatting on save turned off specifically because I noticed this. The example I give above happens when triggering auto-format manually on a saved file, without running it.

@ahurlbatt, please read issue #16180, it's the same problem you're describing. As I said, this bug is totally different.

@ccordoba12 You're right. Apologies!

While investigating an issue in a custom plugin, I stumbled across some potential race condition in autosave + autoformat when running a script. I am able to trigger that race condition (not completely reliable) which leads to leads to the error described in this issue. PR #16505 should fix it.

Hi @rear1019 thanks for digging into this and proposing a solution!


Get rid of gobert in vendor files

Once github.com/landonia/gobert is debianized, it should be added as build dependency to prometheus-rabbitmq-exporter instead of keeping it in ./vendor.

Hi,
I thonk gobert is not actively mantained anymore.
I've forked it and did some small optimisations. I would recommend to add the fork as build dependency: https://github.com/kbudde/gobert

Oh, thank you, I'll take it into consideration.


Unable to claim PPY (BTS share-drop)

Using the 0.1.8 osx build.
After inputting Owner WIF, and clicking on "Login and claim", I get this:

I tripple checked to make sure the key is right.

You need to put in the redemption key which got issued during the ICO, not the Owner WIF.
Or do you mean your bitshares owner wif? Try it via the CLI_WALLET... To just login with your BTS Username only prepending it with 'BTS-yourbtsusernamehere' and then your WIF.
Then just transfer the funds.
kind regards, Roeland

On 27 Jun 2017, at 04:17, Netherdrake<EMAIL_ADDRESS>wrote:
Using the 0.1.8 osx build.
After inputting Owner WIF, I get this:
https://user-images.githubusercontent.com/3516903/27567970-7e5431aa-5aef-11e7-9a04-824bf99226d0.png
I tripple checked to make sure the key is right.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/PBSA/peerplays/issues/20, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPJAJ_eY9LC6jWQy2dnn3Uq0ZfPEYy0ks5sIGY6gaJpZM4OGEYs.


Issues: #31, #30, #29, #23, #21, #13, #10, #9

As discussed, please try to make a PR on a per feature base. This will ease things for the respective committers as well as for the reviewer :)

Thanks! As discussed metaSchema.ts will be refactored and contributed with another yet to be opened PR.


requestAnimationFrame and cancelAnimationFrame leaking into global scope

Getting "Error: global leaks detected: requestAnimationFrame, cancelAnimationFrame" when running latest version of lolex with the "--check-leaks" flag in mocha.

Whoops....

This actually broke our unit test inside phatomjs also and they are still breaking. If if comment out any instance of global.requestAnimationFrame and global.cancelAnimationFrame then its starts working using sinon sandbox.
I am using karma, jasmine, sinon and phantomjs.

Fails with what errors?

@gyandeeps, Are you sure you have the latest version of lolex, 2.3.0? This should have been fixed in #143.

yes, i did force 2.3.0. Making the following change makes everything to function fine.
var NOOP = function () { return undefined; };
var timeoutResult = setTimeout(NOOP, 0);
var addTimerReturnsObject = typeof timeoutResult === "object";
var hrtimePresent = (global.process && typeof global.process.hrtime === "function");
var nextTickPresent = (global.process && typeof global.process.nextTick === "function");
var performancePresent = (global.performance && typeof global.performance.now === "function");
// var requestAnimationFramePresent = (global.requestAnimationFrame && typeof global.requestAnimationFrame === "function");
var cancelAnimationFramePresent = (global.cancelAnimationFrame && typeof global.cancelAnimationFrame === "function");

clearTimeout(timeoutResult);

var NativeDate = Date;
var uniqueTimerId = 1;

@gyandeeps no need to do it - if you don't want lolex to override requestAnimationFrame on installation install takes the names of the functions you want to override as a parameter.

The code i have commented out get executed regardless during require time. This issue is only inside phantomjs. To be honest i am not using lolex directly rather sinon consumes it.

Best bet is to use lolex directly and tell it not to overwrite the rAF functions using @benjamingr's suggestion.

To be honest, any access to code global.requestAnimationFrame causes the issue. Also executing the above commented lines is not optional as they get executed during require/import/parse time.

@gyandeeps interesting, I'll try to get phantomjs set up and reproduce this. Reopening in the meantime - if you can create a repo demo demonstrating the issue that'd be helpful.

Did you try it w/ the toFake so the rAF functions aren't overridden? I'm skeptical that's the issue unless there's a bug in PhantomJS.

I will try. Its so hard and it could be many factors. I wish my code was open source then it would have been so easy. Thanks all for help. :smile:


[New game]: Guess the colour from the given RGB coordinates.

🎮 Game Request
Game logic and basic description
A basic game with 3 options for choosing which will be the best colour for the closest match for the asked RGB coordinates.
Point down the features
Game points
A series of questions will be asked and if you get the correct answers more than the wrong ones, you win!
Select program in which you are contributing
GSSoC23
Code of Conduct

[X] I follow CONTRIBUTING GUIDELINE of this project.

Hey @singh-anushka  ! Thank you for raising an issue 💗 You have been assigned this issue you can start working on the issue 🎮

Hey @singh-anushka ! Thank you so much for your raising the issue💗
It’s all yours, you can come anytime again and make some contributions! 🚀
Alone, we can do little, but together we can do so much! 😇


The rename option is now compatible with the starred documents feature

Fixes #149
Changes

Now when a starred document is renamed, it is not removed from the starred box automatically.
Whenever a document is renamed in the pdfs box, if the same document also exists in the starred box, it is also renamed to maintain consistency and to remove all the previous issues.

Major changes in the onTap of Rename feature, rest of the file was automatically formatted in my IDE.
Please review and let me know if any changes are required.
(GSSoC and CWoC participant)

@smaranjitghose can you please add the relevant labels?

@Saransh-cpp Could you please check your PRs and lemme know(tag me in a comment) where we might have missed out the CrossWoc or GSSOC tag for you

@Saransh-cpp Could you please check your PRs and lemme know(tag me in a comment) where we might have missed out the CrossWoc or GSSOC tag for you

Sure, I will look into my PRs and tag you in the necessary places.


Do not implement BoundObject for &Bound

This is mainly an internal issue, but it has to be decided before we stabilize IntoPyObject, because after that it will be a breaking change.
I request that we remove the following impl:
https://github.com/PyO3/pyo3/blob/2f5b45efa10e52a44bb3185dfeb716c2e815a4f8/src/instance.rs#L617-L639
And replace all places where IntoPyObject<Output = &Bound> with Output = Borrowed.
For users, this will be a transparent change, since Borrowed derefs to Bound. So why do I want this?
Borrowed has a feature &Bound doesn't have: it is layout-compatible with *mut ffi::PyObject (and so is Bound). What that means is that a container, for example a Vec, of Borrowed can be treated as *mut *mut ffi::PyObject (an array of *mut ffi::PyObject) for the purposes of FFI.
This may sound unimportant, but this can enable speedups. For example, the pycall!() macro I'm experimenting with, we can unpack any set of objects. Internally, if the number of entries is not constant (in which case we use a stack array), the macro allocates a Vec and fills it with the values. For convenience, the macro accepts any value that is IntoPyObject.
Ideally, we will construct one Vec, and use it to store all arguments. And we need to store them twice: once because they may be Bounds and need dropping, and the other as *mut ffi::PyObject to pass to the C FFI. Ideally, these two will collapse, and we will use one Vec for both for all arguments.
There is one obstacle for that: this impl. with this impl, we cannot take IntoPyObject::Output and treat it as *mut ffi::PyObject, because it may be a &Bound, which is actually *const *mut ffi::PyObject. That forces us to use two or more Vecs when one is enough.
It can be worked around by complicating BoundObject more (adding another fn and associated type for "if this is a &Bound convert it to Borrowed), but given the little utility of this impl, I suggest we just remove it.

Overall this seems like a smart idea; however I think we should note that this makes BoundObject an unsafe trait, which might scare users a little bit given that BoundObject is very user-facing as the result of IntoPyObject. Not necessarily a deal-breaker, just worth considering.

Maybe we make a sealed supertrait of BoundObject, e.g. unsafe trait LayoutCompatibleWithFFIPyObject: Sealed { } or similar, if we want to make the unsafe a little less upfront for readers.

Overall this seems like a smart idea; however I think we should note that this makes BoundObject an unsafe trait, which might scare users a little bit given that BoundObject is very user-facing as the result of IntoPyObject. Not necessarily a deal-breaker, just worth considering.

BoundObject is sealed, so it doesn't matter for users if it's unsafe or not.

Maybe we make a sealed supertrait of BoundObject, e.g. unsafe trait LayoutCompatibleWithFFIPyObject: Sealed { } or similar, if we want to make the unsafe a little less upfront for readers.

But then users can implement IntoPyObject with Output = &Bound, which will mean their types cannot be used in this optimizations, which is unfortunate. We should teach users to use Borrowed instead.

This seems like a good optimization opportunity. I originally added that impl to make it easier for users to implement IntoPyObject without reference counting overhead while keeping Borrowed out of the picture (since we tried that in 0.21/0.22). We currently use it in a few places, but I think all of them can easily switch to Borrowed instead.  I think with 0.23 Borrowed will show up in a few more places due to optimizations (for example #4390 also uses it), so maybe have to accept that and document clearly what it means, and how it's used.
I agree that we should mark it as unsafe if we rely on layout compatibility of all implementors.

Maybe we make a sealed supertrait of BoundObject, e.g. unsafe trait LayoutCompatibleWithFFIPyObject: Sealed { } or similar, if we want to make the unsafe a little less upfront for readers.

But then users can implement IntoPyObject with Output = &Bound, which will mean their types cannot be used in this optimizations, which is unfortunate. We should teach users to use Borrowed instead.

I think these two points don't necessarily contradict each other. We can add such a supertrait, while also removing the impl, but personally I don't think it's necessary. We can and should document the contract in the safety docs of BoundObject, but in the end users don't really need to interact with it too much. They can't implement it themselves and we can teach in the IntoPyObject docs that they can use either Bound or Borrowed as the Output type (and when each is appropriate).

Right, I am forgetting that users will typically call .into_pyobject() on a known type and will have a concrete type that they get back; they won't need to then go via the trait to use the result.
So 👍 let's move ahead with this.


Support exemplars in Thanos sidecar and querier

As mentioned in today's public meeting, it would be good if we can support exemplars in Thanos.
Blocked by the upstream WIP pr.
As there is no design to persist exemplars right now, we can start from supporting Thanos sidecar to query the /api/v1/query_exemplars API from Prometheus.
Describe the solution you'd like

Add ExemplarQuerier interface and /api/v1/query_exemplars API to thanos querier.
Add one more gRPC API to query exemplars.
Implement this gRPC API in the proxy store, which performs fanout exemplar queries.
Implement this gRPC API in Thanos sidecar, which simply calls the same HTTP API from Prometheus

I can work on this if that's okay with some guidance.

@goku321 go for it. We are happy to guide you :hugs:
Feel free to propose this on our new Contributor Office Hours if you want to meet & collab :heart: (will be announced wider today): https://docs.google.com/document/d/137XnxfOT2p1NcNUq6NWZjwmtlSdA6Wyti86Pd6cyQhs/edit#heading=h.cifspg8gw2m5

Added some detailed steps here: https://github.com/thanos-io/thanos/issues/3345#issuecomment-737172268
Those also applies to Exemplars (: @goku321

Just a heads up. work is in progress, will create a PR soon.

Just a heads up. work is in progress, will create a PR soon.

Amazing @goku321 ❤ Can't wait!

Amazing @goku321 ❤ Can't wait!

Added some detailed steps here: #3345 (comment)
Those also applies to Exemplars (: @goku321

The current design is that exemplars are only in memory, so only Sidecar supports it now. I feel it is possible that exemplars can be supported via remote write so the TSDB store might need to support this, too. If we need to persist it in the future, then store gateway might need to have this as well.
If we choose the proxy way like rules API, what's the benefit of this over adding it to the general store gRPC API?

Added some detailed steps here: #3345 (comment)
Those also applies to Exemplars (: @goku321

The current design is that exemplars are only in memory, so only Sidecar supports it now. I feel it is possible that exemplars can be supported via remote write so the TSDB store might need to support this, too. If we need to persist it in the future, then store gateway might need to have this as well.
If we choose the proxy way like rules API, what's the benefit of this over adding it to the general store gRPC API?

store gRPC API?

What exactly do you mean? Adding another method? Adding another field to Series response (which might make less sense as there is literally Examplars API (another endpoint).)?
If it's another method that it's not a big difference for gRPC if it's part of same API or different.

via remote write so the TSDB store might need to support this, too.

While definitely, we want to push it via remote write some day (or something along those lines), the current plan is to don't extend TSDB format with this. In that case it will be stored in different way so might be the case that some Thanos component will expose Exemplars API but not store API.
I believe we could start as a separate API/method as this allows us flexibility. Nothing bad in store gateway exposing both Examplars API and Series API, no? (:

store gRPC API?

What exactly do you mean? Adding another method? Adding another field to Series response (which might make less sense as there is literally Examplars API (another endpoint).)?
If it's another method that it's not a big difference for gRPC if it's part of same API or different.

via remote write so the TSDB store might need to support this, too.

While definitely, we want to push it via remote write some day (or something along those lines), the current plan is to don't extend TSDB format with this. In that case it will be stored in different way so might be the case that some Thanos component will expose Exemplars API but not store API.
I believe we could start as a separate API/method as this allows us flexibility. Nothing bad in store gateway exposing both Examplars API and Series API, no? (:

I believe we could start as a separate API/method as this allows us flexibility. Nothing bad in store gateway exposing both Examplars API and Series API, no? (:

Yes, that makes sense.

I believe we could start as a separate API/method as this allows us flexibility. Nothing bad in store gateway exposing both Examplars API and Series API, no? (:

Yes, that makes sense.

I believe we could start as a separate API/method as this allows us flexibility. Nothing bad in store gateway exposing both Examplars API and Series API, no? (:

Yes, that makes sense.

I believe we could start as a separate API/method as this allows us flexibility. Nothing bad in store gateway exposing both Examplars API and Series API, no? (:

Yes, that makes sense.

@bwplotka I would like to work on this, also previously I have worked with gRPC. Could help me with where I should begin with I was  going through the contributor office hours but I think it's not updated since few days.

Hi @Debanitrkl I know I'm taking a bit of time on this but I am very close to finish this one 😅

Hi @bwplotka, since @goku321 is already working on this, is the related LFX mentorship task (Thanos: gRPC Exemplars API) still valid?


Adding other powershell modules/scripts

Hi! First of all, awesome workaround! But I wonder how to add other Powershell modules/scripts to this. Can you please give me some brief explantation on how to accomplish this? Do I include it somewhere upon compiling?

yes, for example Invoke-Mimikatz would be awesome to add

any help on this? in the "README.md" it mentions that other scripts can be added in a similar manner, but there's no statements on how?


Dev server should not start when plugin config server to be middlewareMode

Describe the bug
When a plugin has the dev server config middlewareMode to be true, the CLI should not try to start the dev server. In my case, I would use my own server instead of the vite built-in one.
config: () => ({
  server: {
      middlewareMode: true,
  },
}),

Reproduction
https://github.com/axe-me/dev-server-shouldnt-start
System Info

vite version: 2.x
Operating System: macOS
Node version: 14
Package manager (npm/yarn/pnpm) and version: npm 6.x

Logs (Optional if provided reproduction)

vite

error when starting dev server:
Error: Cannot call server.listen in middleware mode.
Solution
dont run await server.listen() when resolved config has middlewareMode enabled

@underfin Thank you for looking at this. I created a PR as well yesterday, for some reason it did not link to this issue. https://github.com/vitejs/vite/pull/2095
Anyway the way you doing it looks better. I gonna close mine.

I don't know if this should be a supported case, since this is allowing a plugin to replace the actual Vite http server and breaks the fix in #2101 breaks the API contract where listen() should aways return the server instance. Starting a server in configureServer also feels quite wrong.
I think a better, more explicit usage is to expose a CLI binary from your plugin which starts the server and uses Vite in middleware instead. So instead of vite, the user runs vite-express instead.

A CLI bin makes sense, that actually was my first attempt. The reason I switch to the plugin approach is the ViteDevServer not expose the handleHotUpdate hook which is needed for me to know when to restart the node server. https://github.com/vitejs/vite/discussions/2077#discussioncomment-384065
I could create a PR to add some lifecycle hooks options to the dev server if you think it's OK.
Another idea is to add a handler to dev server and invoke it in hmr.send, so that the node server would know all the events the hmr sending out. I can create a PR for this as well, see which way you prefer.
@yyx990803

I just realized I could just connect to the WebSocket server created by vite. None of those proposals above aren't needed anymore.


Check if a file is a file (and not a directory) before reading it

This fixes a bug where the loader attempts to read directories if they're named *.js. We ran into this with some of our dependencies: Chart.js and less.js, both installed via bower.

Looks good and seems to work for me. I will merge it but will wait for a realese for the other PR.


Unable to register sw, Is this error expected in local

You can only register a service worker in a server environment. It won't work if you just open the files in your browser.