Crash when loading insane amount of events on one day.

When showing a great amount of events (screenshot attached), the CalendarView crashes. The last line of the code below crashes with EXC_BAD_INSTRUCTION:
open func getCurrentEvent(with indexPath: IndexPath) -> JZBaseEvent? {
    let date = flowLayout.dateForColumnHeader(at: indexPath)
    return isAllDaySupported ? notAllDayEventsBySection[date]?[indexPath.row] : allEventsBySection[date]?[indexPath.row]
}

I don't believe it is a good idea to show that many events, therefore a good fix may be to allow a "more events" cell that shows when 3 or 4 events are at the same time.
Another approach may be the solution by Apple, where they overlay certain items, but it also gets very confusing with many events.

I haven't encountered this situation, could you send me your event data?

Sure, so these are the events (the use case is actually a list of all the events for SXSW this year, we show them in a different view as well thought).
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x6000017a0370 h=--& v=--& UIView:0x7fc52a81ae80.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001782800 H:[UILabel:0x7fc52a81b060'#BigGayKickoff Party']-(3)-|   (active, names: '|':UIView:0x7fc52a81ae80 )>",
"<NSLayoutConstraint:0x600001782850 H:|-(5)-[UILabel:0x7fc52a81b060'#BigGayKickoff Party']   (active, names: '|':UIView:0x7fc52a81ae80 )>",
"<NSLayoutConstraint:0x6000017828f0 UILabel:0x7fc52a81b530'Oilcan Harry's'.trailing == UILabel:0x7fc52a81b060'#BigGayKickoff Party'.trailing   (active)>",
"<NSLayoutConstraint:0x600001782990 UILabel:0x7fc52a81b530'Oilcan Harry's'.leading == UILabel:0x7fc52a81b060'#BigGayKickoff Party'.leading   (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000017828f0 UILabel:0x7fc52a81b530'Oilcan Harry's'.trailing == UILabel:0x7fc52a81b060'#BigGayKickoff Party'.trailing   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.625409+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x6000017a0370 h=--& v=--& UIView:0x7fc52a81ae80.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001782800 H:[UILabel:0x7fc52a81b060'#BigGayKickoff Party']-(3)-|   (active, names: '|':UIView:0x7fc52a81ae80 )>",
"<NSLayoutConstraint:0x600001782850 H:|-(5)-[UILabel:0x7fc52a81b060'#BigGayKickoff Party']   (active, names: '|':UIView:0x7fc52a81ae80 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001782800 H:[UILabel:0x7fc52a81b060'#BigGayKickoff Party']-(3)-|   (active, names: '|':UIView:0x7fc52a81ae80 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.638013+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001783b10 h=--& v=--& UIView:0x7fc52a816640.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001781900 H:[UILabel:0x7fc52a816820'ATX Crawfish Festival']-(3)-|   (active, names: '|':UIView:0x7fc52a816640 )>",
"<NSLayoutConstraint:0x600001781950 H:|-(5)-[UILabel:0x7fc52a816820'ATX Crawfish Festival']   (active, names: '|':UIView:0x7fc52a816640 )>",
"<NSLayoutConstraint:0x6000017819f0 UILabel:0x7fc52a816cf0'Barton Creek Square'.trailing == UILabel:0x7fc52a816820'ATX Crawfish Festival'.trailing   (active)>",
"<NSLayoutConstraint:0x600001781a90 UILabel:0x7fc52a816cf0'Barton Creek Square'.leading == UILabel:0x7fc52a816820'ATX Crawfish Festival'.leading   (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000017819f0 UILabel:0x7fc52a816cf0'Barton Creek Square'.trailing == UILabel:0x7fc52a816820'ATX Crawfish Festival'.trailing   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.638523+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001783b10 h=--& v=--& UIView:0x7fc52a816640.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001781900 H:[UILabel:0x7fc52a816820'ATX Crawfish Festival']-(3)-|   (active, names: '|':UIView:0x7fc52a816640 )>",
"<NSLayoutConstraint:0x600001781950 H:|-(5)-[UILabel:0x7fc52a816820'ATX Crawfish Festival']   (active, names: '|':UIView:0x7fc52a816640 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001781900 H:[UILabel:0x7fc52a816820'ATX Crawfish Festival']-(3)-|   (active, names: '|':UIView:0x7fc52a816640 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.639543+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001783480 h=--& v=--& UIView:0x7fc52a8141b0.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001781180 H:[UILabel:0x7fc52a814390'BBQ Austin']-(3)-|   (active, names: '|':UIView:0x7fc52a8141b0 )>",
"<NSLayoutConstraint:0x6000017811d0 H:|-(5)-[UILabel:0x7fc52a814390'BBQ Austin']   (active, names: '|':UIView:0x7fc52a8141b0 )>",
"<NSLayoutConstraint:0x600001781270 UILabel:0x7fc52a814860'Rodeo Austin - Outside ci...'.trailing == UILabel:0x7fc52a814390'BBQ Austin'.trailing   (active)>",
"<NSLayoutConstraint:0x600001781310 UILabel:0x7fc52a814860'Rodeo Austin - Outside ci...'.leading == UILabel:0x7fc52a814390'BBQ Austin'.leading   (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001781270 UILabel:0x7fc52a814860'Rodeo Austin - Outside ci...'.trailing == UILabel:0x7fc52a814390'BBQ Austin'.trailing   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.640089+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001783480 h=--& v=--& UIView:0x7fc52a8141b0.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001781180 H:[UILabel:0x7fc52a814390'BBQ Austin']-(3)-|   (active, names: '|':UIView:0x7fc52a8141b0 )>",
"<NSLayoutConstraint:0x6000017811d0 H:|-(5)-[UILabel:0x7fc52a814390'BBQ Austin']   (active, names: '|':UIView:0x7fc52a8141b0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001781180 H:[UILabel:0x7fc52a814390'BBQ Austin']-(3)-|   (active, names: '|':UIView:0x7fc52a8141b0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.641195+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001782df0 h=--& v=--& UIView:0x7fc52a811f10.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001780a50 H:[UILabel:0x7fc52a8120f0'Energizing Health House D...']-(3)-|   (active, names: '|':UIView:0x7fc52a811f10 )>",
"<NSLayoutConstraint:0x600001780aa0 H:|-(5)-[UILabel:0x7fc52a8120f0'Energizing Health House D...']   (active, names: '|':UIView:0x7fc52a811f10 )>",
"<NSLayoutConstraint:0x600001780b40 UILabel:0x7fc52a8125c0'Cooper's Old Time Bar-B-Q...'.trailing == UILabel:0x7fc52a8120f0'Energizing Health House D...'.trailing   (active)>",
"<NSLayoutConstraint:0x600001780be0 UILabel:0x7fc52a8125c0'Cooper's Old Time Bar-B-Q...'.leading == UILabel:0x7fc52a8120f0'Energizing Health House D...'.leading   (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001780b40 UILabel:0x7fc52a8125c0'Cooper's Old Time Bar-B-Q...'.trailing == UILabel:0x7fc52a8120f0'Energizing Health House D...'.trailing   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.641719+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001782df0 h=--& v=--& UIView:0x7fc52a811f10.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001780a50 H:[UILabel:0x7fc52a8120f0'Energizing Health House D...']-(3)-|   (active, names: '|':UIView:0x7fc52a811f10 )>",
"<NSLayoutConstraint:0x600001780aa0 H:|-(5)-[UILabel:0x7fc52a8120f0'Energizing Health House D...']   (active, names: '|':UIView:0x7fc52a811f10 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001780a50 H:[UILabel:0x7fc52a8120f0'Energizing Health House D...']-(3)-|   (active, names: '|':UIView:0x7fc52a811f10 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.643559+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001780c30 h=--& v=--& UIView:0x7fc524ef2cc0.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001780370 H:[UILabel:0x7fc524ef31a0'Fort Worth on Rainey']-(3)-|   (active, names: '|':UIView:0x7fc524ef2cc0 )>",
"<NSLayoutConstraint:0x6000017803c0 H:|-(5)-[UILabel:0x7fc524ef31a0'Fort Worth on Rainey']   (active, names: '|':UIView:0x7fc524ef2cc0 )>",
"<NSLayoutConstraint:0x600001780460 UILabel:0x7fc524ef3670'Bungalow'.trailing == UILabel:0x7fc524ef31a0'Fort Worth on Rainey'.trailing   (active)>",
"<NSLayoutConstraint:0x600001780500 UILabel:0x7fc524ef3670'Bungalow'.leading == UILabel:0x7fc524ef31a0'Fort Worth on Rainey'.leading   (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001780460 UILabel:0x7fc524ef3670'Bungalow'.trailing == UILabel:0x7fc524ef31a0'Fort Worth on Rainey'.trailing   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.644211+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001780c30 h=--& v=--& UIView:0x7fc524ef2cc0.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001780370 H:[UILabel:0x7fc524ef31a0'Fort Worth on Rainey']-(3)-|   (active, names: '|':UIView:0x7fc524ef2cc0 )>",
"<NSLayoutConstraint:0x6000017803c0 H:|-(5)-[UILabel:0x7fc524ef31a0'Fort Worth on Rainey']   (active, names: '|':UIView:0x7fc524ef2cc0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001780370 H:[UILabel:0x7fc524ef31a0'Fort Worth on Rainey']-(3)-|   (active, names: '|':UIView:0x7fc524ef2cc0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.702816+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001782cb0 h=--& v=--& UIView:0x7fc524c99c30.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001788320 H:[UILabel:0x7fc524c99e10'Berlin Saloon']-(3)-|   (active, names: '|':UIView:0x7fc524c99c30 )>",
"<NSLayoutConstraint:0x600001788370 H:|-(5)-[UILabel:0x7fc524c99e10'Berlin Saloon']   (active, names: '|':UIView:0x7fc524c99c30 )>",
"<NSLayoutConstraint:0x600001788410 UILabel:0x7fc524c97140'Buffalo Billiards'.trailing == UILabel:0x7fc524c99e10'Berlin Saloon'.trailing   (active)>",
"<NSLayoutConstraint:0x6000017884b0 UILabel:0x7fc524c97140'Buffalo Billiards'.leading == UILabel:0x7fc524c99e10'Berlin Saloon'.leading   (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001788410 UILabel:0x7fc524c97140'Buffalo Billiards'.trailing == UILabel:0x7fc524c99e10'Berlin Saloon'.trailing   (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-02-21 08:58:33.703357+0100 Butleroy[23795:1359532] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x600001782cb0 h=--& v=--& UIView:0x7fc524c99c30.width == 6.4   (active)>",
"<NSLayoutConstraint:0x600001788320 H:[UILabel:0x7fc524c99e10'Berlin Saloon']-(3)-|   (active, names: '|':UIView:0x7fc524c99c30 )>",
"<NSLayoutConstraint:0x600001788370 H:|-(5)-[UILabel:0x7fc524c99e10'Berlin Saloon']   (active, names: '|':UIView:0x7fc524c99c30 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600001788320 H:[UILabel:0x7fc524c99e10'Berlin Saloon']-(3)-|   (active, names: '|':UIView:0x7fc524c99c30 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

Hi, I'm also facing this crash, can you help me on how to avoid this case, I'm not even using much data.

@yashlangaliya I am currently fixing this issue, could you send me your data to test?


Machine resource doesnt seem to work as expected in machine_batch

I tried converging multiple machine resources in a machine_batch but it did not work as expected.  I don't know if this is an issue with this driver or with the machine_batch resource, but it created 3 VMs, and then converged the same vm 3 times as 3 different nodes.  Likewise, when destroying in machine_batch, all 3 nodes were unregistered from the chef server, but only one of the VMs was actually destroyed.
I was running from Chef-zero using Chef-client 12.3.0 on Windows 10.

Could you include the recipe or a gist? Thanks!

This is the (de-identified) recipe.  Its just a simple POC so excuse the mess and comments...
FYI - when I pull out the "machine_batch" it runs sequentially and seems to converge the nodes correctly.
# Cookbook Name:: bsk-vmware-provisioner-poc
# Recipe:: default
#
# Copyright (c) 2015 The Authors, All Rights Reserved.

chef_gem 'chef-provisioning-vsphere' do
	action :install
	compile_time true
end

require 'chef/provisioning/vsphere_driver'

with_vsphere_driver host: '<IP_ADDRESS>',
		insecure: true,
		user:     'mycompany\vm_admin_username',
		password: 'vmware_password'

with_machine_options({
  :bootstrap_options => {
    use_linked_clone: false,
    num_cpus: 2,
    memory_mb: 4096,
    network_name: ["VMNET.DMZ"],
    datacenter: 'HQ-DC',
    resource_pool: 'LAB',
    template_name: 'lab1temp2012R2',
    template_folder: 'LAB/Templates',
    vm_folder: 'LAB',
    datastore: 'RAID5-LUN20 (LAB)',
    customization_spec: {
      ipsettings: {
        dnsServerList: ['<IP_ADDRESS>'] #dns list is required even when using dhcp.  And the error message is a nil for nilclass error.  had to grep the code to figure it out
      },
      domainAdmin<EMAIL_ADDRESS>      domainAdminPassword: 'admin_password',
      org_name: 'MyCompany, inc',
      product_id: 'AAAAA-AAAAA-AAAAA-AAAAA-AAAAA', #If this is wrong it fails creating the unattend file
      win_time_zone: 4, # this is required.  I dont know what 4 is, so we'll need to change this
      domain: 'lab.mycompany.com'
    },
    ssh: {
      #user<EMAIL_ADDRESS>      user: 'mycompany\admin_username', ##this MUST be in netbios name format, apparently
      password: 'admin_password',
      paranoid: false,
    },
  },
  convergence_options: {
    ssl_verify_mode: :verify_none #required bc of the self-signed cert
  }
})

chef_server_settings =  {
  chef_server_url: 'https://chefserver.lab.mycompany.com/organizations/mycompany',
  options: {
    client_name: 'jsmyth',
    signing_key_filename: 'C:/Users/jsmyt_000/src/mycompany/.chef/jsmyth.pem',
  }
}

ivr_attributes  = {
    'ivr_artifact_url' => 'http://build.hq.mycompany.com/view/All/job/Brainshark.Services.IVR/15/artifact/BuildArtifact/Brainshark.Services.IVR.msdeploy.zip'
  }

num_ivr_servers = 3
machine_batch do
  retries 5
  retry_delay 30
  1.upto(num_ivr_servers) do |i|

    machine "QA1JSMYTH#{i.to_s.rjust(2,"0")}" do
      action :converge
    	 run_list [ 'role[ivr-application]' ]
      chef_server chef_server_settings
      chef_environment 'qa'
      attributes ivr_attributes
      retries 5
      retry_delay 30
    end
  end
end

I have not had any luck reproducing this and have a recipe almost identical to yours. Using chef zero with windows nodes pointing to a real chef server and inside of a machine_batch. I too am using chef v 12.3.0.
Other key gems:
cheffish 1.3.0
chef-provisioning 1.2.0 (then tried with 1.3.0)
Getting a full log of the run may help to troubleshoot further.

This is my first experience with Azure provisioning, so I apologize if I'm totally off base here, but it looks like the machine_spec being passed to allocate_machine is the same for all 3 machines.  The server_id is the one the same, and is the one set on QAJSMYTH02 in chef.  Relevant code snippet:
 * machine_batch[mybatch] action converge[2015-08-21T15:36:21-05:00] WARN: Checking to see if {"driver_url"=>"vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true", "driver_version"=>"0.7.1", "server_id"=>"50120ead-c79b-6ea3-e57f-69ba300a8d2e", "is_windows"=>true, "allocated_at"=>"2015-08-21 18:21:00 UTC", "ipaddress"=>"<IP_ADDRESS>"} has been created...
[2e0s1t5a-bl08i-s2hi1nTg 1c5onn:ec3t6i:o2n1 -to0 51:00.30]0. W4A5R.1N:7 0C
cking to see if {"driver_url"=>"vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true", "driver_version"=>"0.7.1", "server_id"=>"50120ead-c79b-6ea3-e57f-69ba300a8d2e", "is_windows"=>true, "allocated_at"=>"2015-08-21 18:21:00 UTC", "ipaddress"=>"<IP_ADDRESS>"} has been created...
[e20s1t5a-0b8-l21T15i:s3h6:i2n1g- 05co:0n0]n ecWtAiRoN:n C hteco ki1n0g .t30o .see if4 {5"d.river1_7u0rl
=>"vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true", "driver_version"=>"0.7.1", "server_id"=>"50120ead-c79b-6ea3-e57f-69ba300a8d2e", "is_windows"=>true, "allocated_at"=>"2015-08-21 18:21:00 UTC", "ipaddress"=>"<IP_ADDRESS>"} has been created...
establishing connection to <IP_ADDRESS>
[2015-08-21T15:36:21-05:00] WARN: returning existing machine
[2015-08-21T15:36:21-05:00] WARN: returning existing machine
[2015-08-21T15:36:21-05:00] WARN: returning existing machine

    - [QA1JSMYTH01] Power on VM [IVR/QA1JSMYTH02]
    - [QA1JSMYTH02] Power on VM [IVR/QA1JSMYTH02]
    - [QA1JSMYTH03] Power on VM [IVR/QA1JSMYTH02]

That does indeed look like its the case and very wrong. One thing I'd do if you have not already is not only delete the VMs but also the nodes from your chef server before trying again. That may or may not make a difference. Also what version of chef-provisioning are you using?

I was running chef-provisioning 1.1.1 and cheffish 1.2.  I tried chef-provisioning 1.3.0  and cheffish 1.3.0 and had the same results, though I did not fully delete the objects before I ran that test.  I'll clean that up and retry from scratch with the new versions.

I cleaned up all the objects and re-ran using cheffish 1.3.0 and chef-provisioning 1.3.0 and had the same results.  The VMs get created, and each has a unique server_id, and each Chef node gets created with that Id:

[QA1JSMYTH03] Machine - created - QA1JSMYTH03 (5012b72c-b74c-a3f8-f66b-8e123075ca6d on vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true)[2015-08-24T08:56:52-05:00] WARN: Class Chef::Provider::ChefNode does not declare 'resource_name :chef_node'.
[2015-08-24T08:56:52-05:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.

    - [QA1JSMYTH01] Machine - created - QA1JSMYTH01 (50129758-47d9-2de3-66ed-59374056e976 on vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true)[2015-08-24T08:56:52-05:00] WARN: Class Chef::Provider::ChefNode does not declare 'resource_name :chef_node'.
[2015-08-24T08:56:52-05:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.

    - [QA1JSMYTH02] Machine - created - QA1JSMYTH02 (50123c10-c3e8-1ed1-4f1e-899a55ba1b7b on vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true)[2015-08-24T08:56:52-05:00] WARN: Class Chef::Provider::ChefNode does not declare 'resource_name :chef_node'.
[2015-08-24T08:56:52-05:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.

but then when Chef provisioning references the servers, it uses the same server_id for all 3 VMS:
    - [QA1JSMYTH03]   add normal.chef_provisioning = {"reference"=>{"driver_url"=>"vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true", "driver_version"=>"0.8.0", "server_id"=>"50123c10-c3e8-1ed1-4f1e-899a55ba1b7b", "is_windows"=>true, "allocated_at"=>"2015-08-24 13:56:52 UTC", "ipaddress"=>nil}}
    - [QA1JSMYTH01]   add normal.chef_provisioning = {"reference"=>{"driver_url"=>"vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true", "driver_version"=>"0.8.0", "server_id"=>"50123c10-c3e8-1ed1-4f1e-899a55ba1b7b", "is_windows"=>true, "allocated_at"=>"2015-08-24 13:56:52 UTC", "ipaddress"=>nil}}
    - [QA1JSMYTH02]   add normal.chef_provisioning = {"reference"=>{"driver_url"=>"vsphere://<IP_ADDRESS>/sdk?use_ssl=true&insecure=true", "driver_version"=>"0.8.0", "server_id"=>"50123c10-c3e8-1ed1-4f1e-899a55ba1b7b", "is_windows"=>true, "allocated_at"=>"2015-08-24 13:56:52 UTC", "ipaddress"=>nil}}

Do you think this might be a chef provisioning issue, and not a driver issue?

Possibly. Its hard to say. I've tried a multitude of ways to reproduce this without any luck but I'm reluctant to "pass the buck". One thing that would help would be to get a complete bundle list of your gems to ensure we are testing the same bits. If you are not using bundle exec already, could you run bundle install and include the bundle.lock file in this issue or a gist. I'll also do a bit of diving to see what might cause this scenario.

Thank you guys so much! I was missing a lot in my recipe, since i just copied the basics. I will try this and give it a go. 👍
})
chef_server_settings =  {
chef_server_url: 'https://chefserver.lab.mycompany.com/organizations/mycompany',
options: {
client_name: 'jsmyth',
signing_key_filename: 'C:/Users/jsmyt_000/src/mycompany/.chef/jsmyth.pem',
}
}


AST package crashes parsing newlines in attribute values

I see one crash too. This causes a crash, when parsed:
  <child [value]="\'a\n\nb\'"></child>

I think it is either the escaped ' or the new-line characters.
... going to see if @MichaelRFairhurst can help here.
For the other failures, it looks like CSS shimming is not happening anymore.

@MichaelRFairhurst is it possible to get some help here? I imagine this impacts the analyzer plugin too

We don't yet share expression parsing with angular_ast, so this doesn't, but will, affect the plugin too.
I think we ran into this separately though and fixed it...but I can't find the commit.
You said it crashes, is there a stack trace?

I don't think its the newline, I think this is actually invalid.
<child [value]="\"a\nb\""></child>

would, but as written, that dart code we'll try to parse is `'a\n\nb' which is not valid dart.
This brings up an interestingly tricky question, too. Because, say we evaluated the escapes before handing it to dart. Now we get
0x??a
b
0x??

which is also invalid dart. In fact, even without backslashing the single quotes, it's still an error because it spans multiple lines which dart doesn't allow in string literals.
We should also check that the example I gave that's "valid" works. If we don't remove the escapes, we still try to parse invalid dart because \"a\n\b\" is not valid dart either.
We should probably be removing escapes for quotes of the correct type within quotes, and leave the rest alone. Or should we also handle \\ -> \ ?

Ah, I see what you mean. Let me bring this internally, run tests.
Maybe this is something we should just fail on (better failure = better, though)

Should this be closed? Do we have tests that confirm we correctly handle [x]="\"y\""?
Also I think we don't need to handle \\.  This is not valid dart.
You could in theory want to put a \\ before an escaped ", which would be \\\" in dart ie [x]="\"a quote: \\\" \"" but if we treat \\" as a \ before a \"then its still possible albeit unexpected [x]="\" a quote: \\" \"" which is probably OK since its still well specified.
I do think this means our regex requires some tinkering, though, as we're using the "standard" escapes-in-a-string regex which will treat "\\" as a backslash in quotes rather than as a backslash before an escaped quotes character with no matching close quote.

I filed #1122 to track what I've thought about this which is no longer related to the original filing of the ticket


Custom route post/id` flashing 404 before finally rendering page.

I'm currently experiencing a problem with my post/:id routes where next flashes the 404 page before successfully rendering my component. At first, I thought this was a redux related issues as my post/id pages are checking the app state to filter whichever component should be shown using shallow routing.
After discussing this in the slack channel, I added another API call that would retrieve each blog post but quickly found that I still encountered the same issue. I know that this has happened for at least one other developer so i'm wondering if anyone can point me in the right direction? I'm trying to finish up this personal portfolio I built with next.
Below, you can see exactly what's happening. Everything looks A1 except for that 404 that blinks whenever a specific post is rendered.

The benefits i've gained are tremendous however there have been some minor issues like this one that have got me a little puzzled 🤔 . Anyways, let me know if I can provide any additional info. Thanks 😄

Same issue +1

How are you rendering the Link component to that url? Are you using <Link href="/post/1"> or <Link href="/post?id=1" as="/post/1">?

Currently, i'm using <Link prefetch href={/blog/${x.id}} />. I've tried  <Link prefetch href={/blog/${x.id}} as={/blog/${x.id}} /> in the past and just plugged it in again. Still having the same issue.

@sergiodxa I just put this code in place.
<Link href={`/blog?id=${x.id}`} as={`blog/${x.id}`}>
    Read Post
 </Link>

Now it's re-rendering the /blog page on every click while adding the id to the URL.

@tgrecojs Hope this code snippet helps
    const url = `/journal?home=${this.state.article.path[0]}&articlePath=${this.state.article.path[1]}&file=${this.state.article.path[2]}`
    const urlAs = `/journal/${this.state.article.path[0]}/${this.state.article.path[1]}/${this.state.article.path[2]}`

Would render as https://www.someURL.com/journal/articlePath/morePath/evenMorePath

I understand how the path's work @ugiacoman that's not my issue. If you can see in my initial report, i'm successfully navigating to each blog post however the issue is that weird 404 error.

@tgrecojs I made an example repo https://github.com/sergiodxa/next-custom-query (deployed: https://next-custom-query.now.sh/blog), there you can see how to use the custom urls without reloading and a 404 using the next/link component as described above.

@sergiodxa I appreciate that! I just checked it out and added some async calls to the google blogger API which is what i'm currently pinging. Below, you can see how it's navigating to the route but it's not correctly loading the data.

Now this issue is a slightly different reproduction of this issue than what is shown in my first comment. When I first ran into this problem, I thought it was because I was using redux and that the application state wasn't carrying over the post/id pages. This led me to integrating a new API call for each post, just like I integrated in the app you've created, however I still found that I had the same problem.
I was running into some trouble forking your repo 😬 so you can find my code here -> https://github.com/tgrecojs/next-custom-query-async. Let me know you're thoughts! 😄

It looks you're getting  a 400, when forking your project I'm getting that same error with a usageLimits error message. That's probably why you're getting that error.

Ok. I'll investigate a little further but I want to point out that the video I posted when opening the issue is not making an API request on the /blog/:id route. Instead, it's filtering the posts from my redux store which is collected on the /blog route transition so that couldn't be the reason I arrived at this issue. I only implemented the 2nd API call (made inside blog/:id) as I thought it had something to do with my redux-store but found myself receiving the same error but that's not the current implementation in my code.
As soon as I realized that it threw the same bug, I switched back to using only one API call (Inside /blog) and then filtering for the necessary blog post by id.

@sergiodxa I can confirm that it's not usage limits. You'll see that the id isn't always being correctly passed to the /blog/:id route... I've attached the 400 error that i'm receiving. You'll see that id is undefine and (in this instance) it seems to be why i'm getting the error.

I'm also getting 404 flashing without any custom routes. Just a file called orders.js in pages/ with this code:
import { Component } from 'react';

class Orders extends Component {
  render() {
    return (

My Orders

    )
  }
}

export default Orders;

Seems like a pretty critical issue 😅

I tried to replicate it and is because the trailing slash at the end of the URL, if you go to /orders you don't see the 404 but if you go to /orders/ then you see that 404 flashing before the content, this happens either in dev and production mode.

Ah this is a known issue. https://github.com/zeit/next.js/issues/1189

My issue didn't arise due to a trailing slash so there's got to be something else, right?
I've made some changes in my code and i've deployed 2 different versions, one using prefetch and one that doesn't. I want to note that neither application is now able to successfully load a post/:id route.
With Prefetch - https://tgrecojs-hltqztsjpx.now.sh/
One noticed that when I use prefetch in the link, it now throws a Page Does Not Exist Error when rendering the links for each blog post. You can see a screenshot of my console below.

Without Prefetch- https://tgrecojs-qzpspdjrin.now.sh/
When I don't use prefetch, the error shown above no longer exists but it does not render the application. When I initially posted this issue, my component was initializing my blog for each post/:id component. I've since removed that since now individual posts never render.
Let me know if I can provide any more info that can help diagnose this issue. 🤔

@tgrecojs I have almost the exact same problem. prefect did not solve my problem.
The behaviour I get is the following:

Click on the link
A 404 error shows up
The page reloads (??)
The correct page is displayed

I hope this can help debug the issue!
Extra info: Node v6.10.3, Chrome Version 60.0.3112.90

@Theo- the href in that next/link is user?id=1, can you try /user?id=1 instead? I think the 404 is because Next.js is trying to get to /current/path/user?id=1 instead of /user?id=1, but when the page reload it works fine because of the server render.

@sergiodxa that did it. Thank you!

@tgrecojs I had the same flashing 404 behavior. In my case, I had a link with an environment variable which didn't work on the client, therefore the 404 but on the server, it worked. Solved it with https://medium.com/the-tech-bench/next-js-environment-variables-d2f6ea1a1dca.

@andreaskeller hmmm ok i'll check it out. thank you this!!! i'm currently ONLY using my .env variables when the app is server render. I have a higher order component that uses dotenv to check to see it's CSR or SSR, if it is SSR I then dispatch the function needed to log the blog posts.

yeah, I've already got my variables working fine (to my knowledge). I'm rendering that my /blog route using an HOC that gets my BLOGGER_API_KEY so it's working in those examples.... my /post/:ids child pages aren't using any env variables.

Its seems like most of the issues here are fixed. I'll work on this issue as well https://github.com/zeit/next.js/issues/1189
I'm closing this now. But If we need to do something in the core, let me know.

@sergiodxa as per our conversation last night, i've created the lil barebones app showing my issue. Let me know if you have any questions about it! I would be more than happy to fill you in on everything that is going on with it! 😄

Next-blog branch 404-err

I am facing the same issue!
I have three routes /login, /register & /forgot-password. When I navigate between /login & /register, everything is fine but when I go to /forgot-password 404 flashes before rendering the page.
I am confused as these are static routes.
Using UrlPrettifier for routes.

It's not fixed.

I'm experiencing something similar combining the React InstantSearch example with the Parametized Routes example.
Repo: https://github.com/lkbr/next-ris
Example: https://create-next-example-app-cwmdawezzg.now.sh/category/Decoration
Click any refinement to see the 404 flash.

i have the same issue.
I follow the examples, and seems try to reload server-side, i don't know wht

i have the same problem but without any custom routes. I have /pages/pipeline.tsx and /pipeline url works just fine while /pipeline/ flashes 404 and then tries to load my page without calling "getInitialProps" called (since it was 404 on the server!).

@ex3ndr Not sure if this will fix the problem, but I had a similar issue and this cured it.
https://github.com/zeit/next.js#disabling-file-system-routing
Chances are next is trying to pull off the fileSystem before your custom route is hit.

@moaxaca I have solved the same way since i was needed to have my own custom routing - i just disabled next's one altogether.

I'm seeing this issue as well. @moaxaca's solution didn't work for me. What did was to use any Link component, but instead opt for using next-routes's pushRoute method.
Basic example:
import { connect } from 'react-redux'
import { Router } from '../routes'

// ----

export default class Link extends React.Component {

  handleClick(evt, url) {
    evt.preventDefault()
    Router.pushRoute(url)
  }

  render() {
    const { url, title } = this.props

    return (
       this.handleClick(evt, url) }>{title}
    )
  }

}

This seems to figure it out and I don't see the Error Flashing. But it feels a bit quickfixy.

it may be a good idea to check you next.config.js useFileSystemPublicRoutes property. If it is false, that means you must define all the route handlers in server.js yourself.

This fixes the flashing 404 for me:
Link
<Link href="/somepage?id=value" as="/somepage/value">

Server side
server.get("/somepage/:id", (req, res) => {
  return app.render(req, res, "/maps", { id: req.params.id })
})

Access param on page
const { id } = this.props.url.query

So to answer this one once and for all:
href => path inside of the pages directory + the querystring
as => rendered in the browser url bar
Example:
You have a url called /products/:id

You created pages/product.js

export default class extends React.Component {
  static async getInitialProps({query}) {
    console.log('SLUG', query.slug)
    return {}
  }
  render() {
    return
The product page

  }
}

You add the route to express or any other server, this is only for SSR. What this will do is route the url /products/:id to pages/product.js and provide id as part of query in getInitialProps:

server.get("/products/:slug", (req, res) => {
  return app.render(req, res, "/product", { slug: req.params.slug })
})

For client side routing you use next/link like this:

<Link href="/product?slug=something" as="/products/something">

The reason you have to explicitly provide the href and as is that Next.js is not aware of any other pages on the client side. We don't send a manifest of all pages to the client side and subsequent routes get lazy-loaded, which is scalable.
There is a community package that abstracts away providing href and as by sending a pre-defined manifest of all routes, note that we recommend not sending a full manifest of all possible routes as not doing this is more scaleable
https://github.com/fridays/next-routes

Thanks Tim, totally clear explanation!

@timneutkens
If the Link's href and as. I pass the different value. How could I get href's value and as's value.
I test me demo. I think req.params.slug will be as's value. Then how could I get href's value.

@timneutkens You saved me I don't know how many hours of painful search for my issue :D

How are you rendering the Link component to that url? Are you using <Link href="/post/1"> or <Link href="/post?id=1" as="/post/1">?

You should put this in doc. :joy:

So to answer this one once and for all:
href => path inside of the pages directory + the querystring
as => rendered in the browser url bar
Example:
You have a url called /products/:id

You created pages/product.js

export default class extends React.Component {
  static async getInitialProps({query}) {
    console.log('SLUG', query.slug)
    return {}
  }
  render() {
    return
The product page

  }
}

You add the route to express or any other server, this is only for SSR. What this will do is route the url /products/:id to pages/product.js and provide id as part of query in getInitialProps:

server.get("/products/:slug", (req, res) => {
  return app.render(req, res, "/product", { slug: req.params.slug })
})

For client side routing you use next/link like this:

<Link href="/product?slug=something" as="/products/something">

The reason you have to explicitly provide the href and as is that Next.js is not aware of any other pages on the client side. We don't send a manifest of all pages to the client side and subsequent routes get lazy-loaded, which is scalable.
There is a community package that abstracts away providing href and as by sending a pre-defined manifest of all routes, note that we recommend not sending a full manifest of all possible routes as not doing this is more scaleable
https://github.com/fridays/next-routes
Also, note that rendering 404 is no longer the default behavior of Next.js. Instead, we reload the page for the Zones feature.

what I can do if I only have an array of list header like:
[ home: '/home', about:'/about' ].
In next I only get as's value, but how about href ? Thanks :D

What if you're using router.push() instead of <Link> how can you achieve the same results?

@justinmchase I just had the same problem. Check Next Router documentation if you haven't already.
You can use it as Router.push(url, as, options):
Router.push('/post/[pid]', '/post/abc')

@justinmchase the equivalent of
<Link href="/product?slug=something" as="/products/something">

with router.push() is:
router.push("/product?slug=something", "/products/something")

@timneutkens I would like to host my next.js app on ZEIT.now but that doesn't have an option to run an express server. Do I loose my pretty urls now and can only do param=value&param=value or is there another way? The example Sergio posted doesn't look promising

@timneutkens I would like to host my next.js app on ZEIT.now but that doesn't have an option to run an express server. Do I loose my pretty urls now and can only do param=value&param=value or is there another way? The example Sergio posted doesn't look promising

You don't need a custom server for dynamic routes, see https://nextjs.org/docs/routing/dynamic-routes

@timneutkens  Thank you for your fast reply, I tried dynamic routes but will break single page application (see update). Running locally with next in my package.json script in dev mode.

The correct way to do what you outlined is to create pages/integration/[slug].js
And link to it in this way:
<Link href={`/integration/[slug]`} as={`/integration/${slug}`}>

Hi can I ask why when i call this one
Router.push( '/about?id=1234','/about')
the id cant be retrieve, and the page i am using is [...index].js which is a multi dynamic catch all page, but if I direct to other page that is not dynamic one it can work properly example car.js push to vehicle.js..
Is there a better way where i can push to my dynamic catch all page and then mask the id and still able to retrieve it..?

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.


Day377

Resolves #760.

Pull Request Test Coverage Report for Build 1443

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 100.0%

Totals

Change from base Build 1441:
0.0%

Covered Lines:
5

Relevant Lines:
5

💛  - Coveralls

Do you think this can work with an O(N * k) algorithm?
Create a sorted linked list of size window.
Iterate the sorted linked list to get the median.
Total time: O(k)
Move the window to the next position.
Since we are removing 1 item & removing 1 item, the total time should be k.
Iterate the sorted linked list to get the median.
As we have to move the window N times, the total time will be O(Nk) + O(k) => O(Nk)

Do you think this can work with an O(N * k) algorithm?
Create a sorted linked list of size window.
Iterate the sorted linked list to get the median.
Total time: O(k)
Move the window to the next position.
Since we are removing 1 item & removing 1 item, the total time should be k.
Iterate the sorted linked list to get the median.
As we have to move the window N times, the total time will be O(Nk) + O(k) => O(Nk)

@alexfjw If I understand your proposed algorithm correctly, I believe iterating to replace the next element in the window would result in O(Nk^2) due to an Insertion Sort. For each step in the window, the new value would need to be inserted in the correct position by iterating the linked list window elements to find the insertion point. My current solution is O(N(k log k)).
I think this algorithm can be improved by switching a comparison-sort to a radix sort, but then the performance is debatable based on the range of the possible integer values, problem input size, and window size. O(Nk32) for 32-bit numbers or O(Nk64) for 64-bit numbers.

@alexfjw If I understand your proposed algorithm correctly, I believe iterating to replace the next element in the window would result in O(Nk^2) due to an Insertion Sort. For each step in the window, the new value would need to be inserted in the correct position by iterating the linked list window elements to find the insertion point. My current solution is O(N(k log k)).
I think this algorithm can be improved by switching a comparison-sort to a radix sort, but then the performance is debatable based on the range of the possible integer values, problem input size, and window size. O(Nk32) for 32-bit numbers or O(Nk64) for 64-bit numbers.

Ah. You got a point there, I made a mistake for my first step.
Creating the sorted link list of size k, would take O(k^2)
However, k is less than N, meaning it would cost O(N*k) at most.
The subsequent steps of inserting or removing one item would cost O(k).
Since we have to move the window (N-k) times, the total cost would be O(N*k).

It is true that in general, insertion sort costs O(s^2), s being the size of the list to be sorted and the main cost comes from iterating & inserting s items in to a list of size 1 to s.
However, the number of items we are "inserting" in question is just N, and our list size stays at s.
Therefore, the cost should be O(N*k) rather than O(N*k^2)
Does this clarify better?

Ah. You got a point there, I made a mistake for my first step.
Creating the sorted link list of size k, would take O(k^2)
However, k is less than N, meaning it would cost O(N*k) at most.
The subsequent steps of inserting or removing one item would cost O(k).
Since we have to move the window (N-k) times, the total cost would be O(N*k).

It is true that in general, insertion sort costs O(s^2), s being the size of the list to be sorted and the main cost comes from iterating & inserting s items in to a list of size 1 to s.
However, the number of items we are "inserting" in question is just N, and our list size stays at s.
Therefore, the cost should be O(N*k) rather than O(N*k^2)
Does this clarify better?


Should Dapr provide an endpoint for structured application logging?

The benefits of structured logging (searchability, avoiding data parsing errors etc) are well-known. Most logging libraries, log shippers such as fluentD, and log storage/indexing systems preserve and use log structure. The weak link is the way how application logs are captured: from the standard output of the service container. This requires the log scraper/shipper to parse the data, making the whole log pipeline less robust and less efficient than necessary.
Dapr could improve on the status quo by exposing an endpoint that accepts logs in well-known, structured format, such as JSON or MessagePack. By natively supporting common log destinations via pluggable sinks, Dapr deliver an approachable, complete solution for log shipping that eliminates the data fidelity issues associated with stdout-based logging.
Devil is, as usually, in the details, especially if resiliency and performance are considered.

For high performance, logging should use efficient data format(s). Support vary between platforms/logging libraries.
For high performance, log data should be gathered and formatted in memory and directly sent to log aggregator or final destination in chunks. Cross-process network communication within a pod (how Dapr sidecar works today) is not the best.
For resiliency, the design should account for situations where log aggregator/sink is not available. Log data should then be cached (with size limits) on the local filesystem (if r/w filesystem is available), and re-played when the log aggregator becomes available.

In other words, Dapr probably should not attempt to become another log shipper like Fluent Bit or Vector ☺ But at the same time the structured log fidelity is a real issue and current log shippers do not address it well.
@paulyuk FYI

Maybe not an endpoint, but a flag for structured logs.

While I believe it is a waste of resources for Dapr to reinvent logging, I also believe it is an excellent use of resources for Dapr to ENRICH logging, namely through supporting a service (app) to use structured logging that makes dealing with distributed systems so much easier.  If feasible, this will add a lot of value to Dapr.
I encourage doing a feasibility study, starting with Serilog, and conceptually thinking through how this could work for Serilog, and also how it could be extended to other structured logging formats.  Present the feasibility study conceptually.  Get some feedback.  Then decide if it is worth developing further.

/cc @artursouza @yaron2


Modules gradient issue

My bar have gradient with two colors. When I used version 3.0.5 bar looked like this:

But after aur-git update to version 3.0.5-44-ga682d2a I got this:

Modules has no gradients now. I read the wiki, but there is nothing about it and I tried some combinations with format-background etc. Any help, please? Should I use one color for the bar?
P. S. Sorry about my English, it isn't my primary language.

There is some color weirdness in the latest commits, the issue is tracked in #639.
To confirm that this is actually the issue, could you post the output, when you run polybar with the -s option (for both versions)

Version 3.0.5:
%{l}%{A5:i3wm-wsprev: A4:i3wm-wsnext: A1:i3wm-wsfocus-1:}  %{A A A}  %{A1:thunar / &:A3:terminator --working-directory / &: F#38A1E3} %{F#252229}140%{F- A A F-}  %{A1:thunar ~ &:A3:terminator --working-directory ~ &: F#38A1E3} %{F#252229}343%{F- A A F-}  %{F#38A1E3} %{F- A1:terminator -x htop &:}42%{A}  %{F#38A1E3} %{F- A1:terminator -x htop &:}19%{A}  %{F#38A1E3} %{F- A1:~/.config/polybar/output.sh --battery:}100%{A}%{c}%{A1:~/.config/polybar/output.sh --date:}03:07:16%{A}%{r}%{A1:volmute: A4:volup: A5:voldown: F#38A1E3} %{F-}61%{A A A}  %{F#38A1E3}%{F-} %{A1:~/.config/polybar/output.sh --interfaces &:A3:terminator -x nmtui &:}<IP_ADDRESS>%{A A}  %{A1:xkblayout-state set +1 &: F#38A1E3} %{F#252229}	0%{A F-}  %{A1:~/.config/polybar/output.sh --dropbox-notification &:A3:thunar ~/Downloads/Dropbox &: F#38A1E3} %{F#252229}R%{A A F-}  %{F#38A1E3} %{F#252229}1%{F-}  %{A1:xkblayout-state set +1 &: F#252229}EN%{F#D81A1C A F-}
Version 3.0.5-44-ga682d2a:
%{l}%{A5:i3wm-wsprev: A4:i3wm-wsnext: A1:i3wm-wsfocus-1:}  %{A A A}  %{A1:thunar / &:A3:terminator --working-directory / &: F#38A1E3} %{F#252229}140%{F- A A F-}  %{A1:thunar ~ &:A3:terminator --working-directory ~ &: F#38A1E3} %{F#252229}343%{F- A A F-}  %{F#38A1E3} %{F- A1:terminator -x htop &:}41%{A}  %{F#38A1E3} %{F- A1:terminator -x htop &:}22%{A}  %{F#38A1E3} %{F- A1:~/.config/polybar/output.sh --battery:}100%{A}%{c}%{A1:~/.config/polybar/output.sh --date:}03:05:38%{A}%{r}%{A1:volmute: A4:volup: A5:voldown: F#38A1E3} %{F-}61%{A A A}  %{F#38A1E3}%{F-} %{A1:~/.config/polybar/output.sh --interfaces &:A3:terminator -x nmtui &:}<IP_ADDRESS>%{A A}  %{A1:xkblayout-state set +1 &: F#38A1E3} %{F#252229}	0%{A F-}  %{A1:~/.config/polybar/output.sh --dropbox-notification &:A3:thunar ~/Downloads/Dropbox &: F#38A1E3} %{F#252229}R%{A A F-}  %{F#38A1E3} %{F#252229}1%{F-}  %{A1:xkblayout-state set +1 &: F#252229}EN%{F#D81A1C A F-}
See no difference.

Yeah I don't see any either.
I think I have tracked down the issue. Can you locally revert commit https://github.com/jaagr/polybar/commit/0bd8f1f69a8dfdb2f2800a6612c8acb7e6c86ed2 and recompile and test if that fixes it.

Sorry for delay. I just did read some manuals about git, because I'm not so friendly with it. I reverted commit as you said, recompiled it and it works fine now:

What's now?

Now, we have figured out what the problem is. That commit you reverted sets the background color when rendering a module to the bar background and doesn't consider a gradient here.
I will try to fix this as soon as we merge #729 as it also messes with the colors.

OK! Thanks for help by the way!

@patrick96 Any updates on a fix? Just wanted to know if you've started working on it, because as it stands, this is the only issue left on the 3.1.0 milestone.

Sorry, I forgot about this. I think we can release version 3.1.0 without this fix and just schedule it for 3.2.0, it isn't really a critical bug

@patrick96 hey, I seem to have managed to fix this, do you mind if I submit a PR?

@TonCherAmi Yes! Please do.


Allow keyboard shortcuts for file changes save prompt for Don't Save, Save, and Cancel

When closing a file that has been edited, it asks, "Do you want to save the changes you made to...?" Instead of having to click Don't Save or Cancel with your mouse, it should allow you to press D for "Don't Save", C for "Cancel", or S or Enter for "Save".

@gavin310 Not sure which operation system you are talking about, but on Windows 10 with VSCode 1.38, I could find this feature already. And this OS integration feature has always been there as far as I remember.

's' / 'enter' for Save, 'n' for Don't Save, 'esc' to Cancel

@vedipen Sorry I should've clarified. I'm on OS X.

Best you can do on macOS is this:

(This is an old issue, but might be useful for those who come across this issue in the future.)
Here are the shortcuts, which are universal across all macOS apps:

Don't Save: ⌘D or ⌘⌫
Delete*: ⌘⌫
Cancel: Esc
Save: ⌘S or Enter

* This doesn't apply to VSCode, but since 2011 in OS X Lion [source 1] [source 2], some of the more native macOS apps show a confirmation dialog that also includes the Save File selector. In these dialogs, the Delete button can only be activated with ⌘⌫.

We need a way to make these shortcuts consistent on Windows/MacOS.

On MacOS, CMD+D is ergonomic and can be done with one hand.
On Windows, ALT+N is not ergonomic and requires two hands.

A related suggestion: on Windows, there's a visual underline hint that there's a hotkey.
On MacOS, there isn't. Why not make the hotkeys explicit on the actual buttons, e.g.:
Don't Save (⌘D)
Save (⌘S)
Cancel (Esc)

Any new solution to this annoying missing feature?

Any new solution to this annoying missing feature?

It's such a simple workflow improvement which all macOS apps are implementing. I really don't know why they aren't adding it.

All, this has already been implemented. It works. You can use it.
On macOS you can use the standard keyboard shortcuts that all other apps use:
Don't Save: ⌘D or ⌘⌫
Cancel: Esc
Save: ⌘S or Enter
@bpasero consider locking this issue?

Oh, thanks @szhu.
Though it really is working and also not discoverable... A hint would be very useful...

All, this has already been implemented. It works. You can use it.所有，这已经实施了。有用。你可以使用它。
On macOS you can use the standard keyboard shortcuts that all other apps use:在 macOS 上，您可以使用所有其他应用程序使用的标准键盘快捷键：
Don't Save: ⌘D or ⌘⌫不保存：⌘D 或 ⌘⌫ Cancel: Esc 取消：Esc Save: ⌘S or Enter 保存：⌘S 或 Enter
@bpasero consider locking this issue? 考虑锁定这个问题吗？

Why can't I use these shortcuts now with the latest version?

On Windows, none of the above mentioned hotkeys seem to work (alt+n, ctrl+n, alt+d, ctrl+d)
There is no visual underline of any of the letters either.

@szhu

All, this has already been implemented. It works. You can use it.
On macOS you can use the standard keyboard shortcuts that all other apps use:
Don't Save: ⌘D or ⌘⌫ Cancel: Esc Save: ⌘S or Enter
@bpasero consider locking this issue?

This does not work on MacOS†.
NOT WORKING

⌘D or ⌘⌫ — nothing happens
⌘S — nothing happens

WORKING

Esc — cancels
Tab or Arrow Keys (left + right) — move selection (thin blue line)
Enter — chooses the selected button/action

Is there some extra setting that needs to be enabled for this to function, like you say it does?
VSCode v. 1.91.0
† MacOS Monterey 12.6.3

In MacOs Ventura you need to enable this toggle to be able to use Tab to switch between options.
On older systems it was as described above: https://github.com/microsoft/vscode/issues/80811#issuecomment-542057515


[SPARK-45179][PYTHON] Increase Numpy minimum version to 1.21

What changes were proposed in this pull request?
Increase Numpy minimum version to 1.21
Why are the changes needed?

according to the release history, Numpy 1.15 was released about 5 years ago, while the last maintenance release in 1.21 was released 1 year ago;
with 1.21 as the minimum version, we can discard all version checking in PySpark;
pandas==1.4.4 just depends on numpy>=1.21.0;

Does this PR introduce any user-facing change?
No
How was this patch tested?
search with ag
(spark_dev_310) ➜  spark git:(master) ag --py 'numpy\.__version' python
(spark_dev_310) ➜  spark git:(master)
(spark_dev_310) ➜  spark git:(master) ag --py 'np\.__version' python
python/pyspark/ml/image.py
231:        if LooseVersion(np.__version__) >= LooseVersion("1.9"):

python/pyspark/pandas/typedef/typehints.py
152:    if sys.version_info >= (3, 8) and LooseVersion(np.__version__) >= LooseVersion("1.21"):

python/pyspark/pandas/tests/test_typedef.py
365:            if sys.version_info >= (3, 8) and LooseVersion(np.__version__) >= LooseVersion("1.21"):

python/pyspark/pandas/tests/computation/test_apply_func.py
257:        if sys.version_info >= (3, 8) and LooseVersion(np.__version__) >= LooseVersion("1.21"):

Was this patch authored or co-authored using generative AI tooling?
no

thanks, merged to master


:bug: fix FPU's float-to-signed-integer corner case

Fixing #942

@stnolting if you are okay with being patient for a day I can check the corner case tomorrow (US West Cost time). 99% its okay, there is just something nagging about why I added the extra 2 conditions :)
The good news is its pretty fast to run a check, relatively speaking. Take ~2 hours or so to run the full zfinx compliance test suite with RVVI ISA compares just to ensure that we aren't missing/breaking another corner case :)

@stnolting okay so challenge number 1. When I try and replicate the bug locally I get the following failures. These look like corner case rounding failures somewhere and not necessarily in the hardware btw.
xcelium> run
VIRTUAL_UART: Start Float to signed integer
VIRTUAL_UART: 63: opa = 0x3f000000, opb = 0x00000000 : ref[SW] = 0x00000001 vs. res[HW] = 0x00000000 [FAILED]
VIRTUAL_UART: 191: opa = 0xbf000000, opb = 0x00000000 : ref[SW] = 0xffffffff vs. res[HW] = 0x00000000 [FAILED]
VIRTUAL_UART: Float to signed integer finished!

0x3F abd 0xBF-> +/- 2^-64 respectively. So the question is why the expectation is +/-1 as a 32-bit int vs 0. Without knowing the rounding mode it will be a bit tricky. For almost any round this should end up as a +/- 0 unless the integer used is a long/64-bit. This as the "1" will be shifted soooo far away for 0.5LSB that it shouldn't result in an error. So unless there is a rule in IEEE that it has to be +/- 1 unless the float is 0 exact (which seems odd) there might be an issue here.
It would be good to check the SW float library used, I assume Berkeley softfloat?
I'll spend some time getting the compare stuff to go on my end on the test case. We should also diff our FPU versions as mine is 300/400 lines shorter than yours it seems. We definitely aren't getting the same results. Maybe I missed a commit/messed up a commit?

Without knowing the rounding mode it will be a bit tricky.

The default rounding mode (at least for the hardware) is "round to nearest, ties to even".

I'll spend some time getting the compare stuff to go on my end on the test case. We should also diff our FPU versions as mine is 300/400 lines shorter than yours it seems. We definitely aren't getting the same results. Maybe I missed a commit/messed up a commit?

That's great! Thank you very much! :+1:
I'm on the latest version of the main branch (so no FPU hot-fix) and this is what I get when running a section of @Quma78's code:
Start Float to signed integer
63: opa = 0x3f000000, opb = 0x00000000 : ref[SW] = 0x00000000 vs. res[HW] = 0x00000000 [ok]
191: opa = 0xbf000000, opb = 0x00000000 : ref[SW] = 0x00000000 vs. res[HW] = 0x00000000 [ok]
208: opa = 0xd0000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0x00000000 [FAILED]
Float to signed integer finished!

With the fix from this branch the last test case (208) also passes.

Interesting, let me check my quick hack test setup. Its a bit worrisome that the softfloat we are using disagree what the result should be in the test case, whereas the HW agrees across test case. This might hint at a different problem.
I'll get the latest branch on my local machine and do some diff's today to see whats what. It could be something as simple as rounding mode being different between the two cases. I agree the "default mode" should be round to nearest even (normal round), but because of RISCV ISA "fun" we need to look at the GCC assembly to figure out what the heck it actually did as it either sets it directly in the opcode, change the default round mode, or uses the out-of-reset round mode. Did I mention I hate RISCV float rounding modes ;)
Anywho, I believe the reason for the exception I added was to deal with a specific rounding mode that likely isn't tested in the simple test you have setup. Hence why I'm a tad cautious :)
A note here though is: 0xD0 or (208) is -1.0 * 2^(160-128) or -1.0 * 2^32 which is the sign bit corner case. Which is indeed what that if statement is trying to catch. The exception handling (my shoddy memory here) might be to deal with the case where we are doing a convert to unsigned int. Thinking we should expand the test case with both float to signed and unsigned int.. and trigger all the rounding modes as well, to ensure we aren't missing something.
I did check the compliance tests and I believe 0xD0 exponent is indeed in there, so curious as to why its suddenly popping up.

After setting up my new threadripper pro home workstation with rocky 9 and building everything from scratch - fun :) I can now run the test native and can see the errors from 0xd0 - 0xFF.
As a side effect I know have a rocky 9/RHEL9 build of the riscv tool chain. If it make sense I can upload it to the pre-built section.

I looked at the intrinsic file to see if it was an issue with rint as it returns a float. Tried rintf and lrintf with no change in behavior.
I checked that the rounding mode is set equal (round-to-nearest in both GCC and HW, default/reset value for both)
In the intrinsix RM is set to 0 which forces round-to-nearest. The alternative is setting it the DYN and relying on the FR CSR.
I then changed the conversion to use the default C case operation:
int32_t fp_test;
...
fp_test = (int32_t)res_hw.float_value;
...
err_cnt += verify_result(i, opa.binary_value, 0, (uint32_t)fp_test, res_hw.binary_value);

This results in a different failure mode:
#3: FCVT.W.S (float to signed integer)...
200: opa = 0xc8000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0xfffe0000 [FAILED]
201: opa = 0xc9000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0xfff80000 [FAILED]
202: opa = 0xca000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0xffe00000 [FAILED]
203: opa = 0xcb000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0xff800000 [FAILED]
204: opa = 0xcc000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0xfe000000 [FAILED]
205: opa = 0xcd000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0xf8000000 [FAILED]
206: opa = 0xce000000, opb = 0x00000000 : ref[SW] = 0x80000000 vs. res[HW] = 0xe0000000 [FAILED]
207: opa = 0xcf000000, opb = 0x00000000 : ref[SW] = 0x00000000 vs. res[HW] = 0x80000000 [FAILED]

Note: for this failure mode, as soon as we hit 0xD0 exponent we get correct matching conversion. The hint here is that something is off somewhere for sure. Not 100% convinced its the hardware yet as I can make it pass by using standard c float casting.
Anywho next up is to see why my work version doesn't fail. The work version utilizes the berkeley soft-float library for float emulation vs math.h. The berkeley soft-float library is the same the float.h uses to fill in the gaps in the zfinx support, e.g. float divide and doubles.

After a bit more research on math.h we find that the rounding mode of float to int conversions is not round to nearest:
https://en.cppreference.com/w/c/numeric/fenv/FE_round

Not sure how to fully interpret this, but it seems like we should be setting the rounding mode to round towards zero if we are using rint for float conversions? or does it only affect casting? It explains why the cast operator experiment is different than rint at least.
For rint, reading the documentation:
https://en.cppreference.com/w/c/numeric/math/rint

From this is seem rint is using "current rounding mode"
Now reading the manual further we get:

As we are converting outside the size of an integer the return value would be: "an implementation-defined value is returned"
I'm guessing this is 0x8000_0000 and not 0x0000_0000 as our current hardware returns.
We should update the test to check whether an FE_INVALID is raised and whether gcc's math.h returns the value expected by RISCV F/Zfinx extension.
I did a small dive into rint to see whats going on there.. its mostly straight up assembly, yeah :| There is a double rint(double x) C example where the return value, if the exponent is >51 (remember double) is just X straight up.
https://www.netlib.org/fdlibm/s_rint.c
I'll dive a bit more. Early indications that we might not actually be looking at a "bug" but a "feature" in math.h. I still need to run the Imperas with softfloat vs the bug to confirm whether it is a bug bug :)

As a side effect I know have a rocky 9/RHEL9 build of the riscv tool chain. If it make sense I can upload it to the pre-built section.

I am not sure if I want to continue with my pre-built toolchains. The X-pack project provides excellent toolchains - so why reinvent the wheel? ;)

In the intrinsix RM is set to 0 which forces round-to-nearest. The alternative is setting it the DYN and relying on the FR CSR.

Good point. I think we should adjust the intrinsics and use the floating point CSR for configuration. This is so much more flexible.

After a bit more research on math.h [...]

Holy cricket! Thanks for all your work!
Seems like we are entering floating point hell here... 🙈

We should update the test to check whether an FE_INVALID is raised and whether gcc's math.h returns the value expected by RISCV F/Zfinx extension.

:+1:

I'll dive a bit more. Early indications that we might not actually be looking at a "bug" but a "feature" in math.h. I still need to run the Imperas with softfloat vs the bug to confirm whether it is a bug bug :)

Thanks again! ❤

I am not sure if I want to continue with my pre-built toolchains. The X-pack project provides excellent toolchains - so why reinvent the wheel? ;)

And here I thought reinventing the wheel was what engineering was all about ;) Makes sense. Forwarded the x-pack link to my firmware SDK person, might be we just pivot to that vs internal build.

After a bit more research on math.h [...]

Holy cricket! Thanks for all your work! Seems like we are entering floating point hell here... 🙈

Welcome to FPU :) I knew what I was signing up for, so not too surprised but still learning. I've yet to pull in favors from my friends that are building Sharc and Tensilica DSPs, but might at some point :)
I will continue to do some more deep diving into the topic. Right now I'm suspecting that the RISCV math.h library was copy->pasted from the x86 library and that might be the root cause. Still not closing the hardware bug avenue, will need to re-read the RISCV spec and the IEEE spec again again.
This is a good bug find though. The fact that we are deep diving this much and learning a lot means, even though it isn't a HW bug, we learned a lot on the debugging journey :)

Welcome to FPU :) I knew what I was signing up for, so not too surprised but still learning.

😅

This is a good bug find though. The fact that we are deep diving this much and learning a lot means, even though it isn't a HW bug, we learned a lot on the debugging journey :)

I can only agree.
Btw, I have modified the Zfinx intrinsics to use the dynamic rounding mode (actual rounding mode defined by fcsr). This makes it easier to play around with all the different rounding modes.

So finally got around to run the testcase locally with RVVI comparison to OVP sim from Imperas.
A few details about my setup is that I'm likely calling gcc with the zfinx extension enabled. This probably means that rint gets replaced with the zfinx extension for everything but corner case handling
xcelium> run
UVM_INFO @ 3564.00 ns: reporter [riscv_tb] Sending reset to reference model
UVM_INFO @ 3564.00 ns: reporter [riscv_tb] Calling rvviTracer.riscv_init
VIRTUAL_UART: Start Float to signed integer
VIRTUAL_UART: 63: opa = 0x3f000000, opb = 0x00000000 : ref[SW] = 0x00000001 vs. res[HW] = 0x00000000 [FAILED]
VIRTUAL_UART: 191: opa = 0xbf000000, opb = 0x00000000 : ref[SW] = 0xffffffff vs. res[HW] = 0x00000000 [FAILED]
VIRTUAL_UART: Float to signed integer finished!

Notice the 2 failures reported seem to be corner case related. But the Imperas compare reports:
Info (IDV) ---------------------------------------------------
Info (IDV) ImperasDV VERIFICATION REPORT
Info (IDV)   Instruction retires   : 44,625
Info (IDV)   Traps                 : 0
Info (IDV)   Interrupt events      : 0
Info (IDV)   Ending cycle count    : 205,741
Info (IDV)                               Sets / Compares
Info (IDV)     PC                  :   44,625 / 44,625
Info (IDV)     Instruction         :   44,625 / 44,625
Info (IDV)     GPR                 :   33,362 / 33,329
Info (IDV)     CSR                 :      531 / 524
Info (IDV)     FPR                 :        0 / 0 (disabled)
Info (IDV)     VR                  :        0 / 0 (disabled)
Info (IDV)
Info (IDV)   Total compares        : 123,103
Info (IDV)   Mismatches            : 0
Info (IDV) ---------------------------------------------------

ImperasDVasync finished: Tue Jul  9 07:58:01 2024

From the reporting you can see the number of compares and mismatches being "0". So Imperas reference implementation "ovpsim" -https://github.com/riscv-admin/riscv-ovpsim- that uses the Berkeley softfloat reference library (the same as Sail and Spike) reports no failures.
Note: the sets vs compares can seem off, that is caused by some instructions updating more than 1 GPR and CSR for a given instruction. FPR is disabled as we don't have the F extension. VR is disabled as we don't have the vector extension.
Next step is to dig into why we see the failures vs the math.h library from RISCV. Also I should probably try a run where I'm not enabling the zfinx extension in gcc.

A few details about my setup is that I'm likely calling gcc with the zfinx extension enabled. This probably means that rint gets replaced with the zfinx extension for everything but corner case handling

But doesn't that mean you are comparing Zfinx (wrapped in some math library) against Zfinx (the intrinsics)? 🤔
Which hardware are you using? The "default" one (aka from the main branch) or the "fix" from this PR?

But doesn't that mean you are comparing Zfinx (wrapped in some math library) against Zfinx (the intrinsics)? 🤔

With gcc compiling with Zfinx enabled, or HW float if you will, means the compiler will likely utilize the fcwt.ws.s instruction and not the emulated function in math.h. Basically the "SW" vs "HW" compare function would always match as its calling the same RISCV instruction under the hood. As the math.h likely has an exception handler is why we see a trigger that causes the 2 failures.
Remember rint is calling a C function that inherently uses float types. So gcc will off-course use any float hardware it can find :)

Which hardware are you using? The "default" one (aka from the main branch) or the "fix" from this PR?
I'm using our internal out-of-date branch. But it has the correct FPU, not the fixed FPU from the PR.
The exercise here is saying: ok we will run the test with the non-fixed FPU and instead of comparing against the math.h implementation we will compared against an actual RISCV reference ISA. The RISCV reference ISA is supposed to handle the FPU correctly per RISCV spec.
The reasoning here is: if we behave correctly per RISCV spec then its likely that the error we are seeing in the rint function is an error in the math.h "implementation specific" results - which I suspect are taken from x86 - and not a bug as we are adhering to the intent of the RISCV specification.

The next step is to deep dive into the RISCV F/Zfinx extension spec and the IEEE 768 float spec to ensure that we are indeed behaving right and its rooted in a mistake in math.h based on yet another ancient x86 float "feature".
If the spec says rint from math.h is right, that is a bug in the RISCV reference ISA. Which would also be bad.

So this is the riscv spec notes on float to signed integer conversion:

From this for FCVT.W.S if the number is out-of-range for a negative input, which I believe is the case, then the resulting integer should be 2^-31 or 0x8000_0000.
Which seems to be happening in my local FPU, my compares don't fail for this corner.
So next step is for me to do a diff. The errors I have seem to be rounding related vs the SW implementation. Need to dig some more, but might be a mistake in the C library, as I'm comparing against the berkeley reference implementation.
@stnolting did you touch the FPU after my checkin? no blame :) just trying to understand why my implementation is something like 400 lines shorter :)

From this for FCVT.W.S if the number is out-of-range for a negative input, which I believe is the case, then the resulting integer should be 2^-31 or 0x8000_0000.

But this is not happening when using the default FPU from the main branch, right?! 🤔

did you touch the FPU after my checkin? no blame :) just trying to understand why my implementation is something like 400 lines shorter :)

Wait, your local version is shorter? It should be the other way around I think. I just trimmed some trailing spaces and reworked the header. No real rtl code edits from my side.

@stnolting I apologize for the Very long delay here. Got stuck in some hairy support case combined with a 2 vacation back to the homeland in europe :)
So I did a diff between the FPU in the tip of trunk and my local one. Besides a number of stylistic differences the one that seems to fall out is:

Where I use hex for the mantissa encoding and you have changed it to a binary value... well that and I sim with xcelium and not ghdl.. but that shouldn't matter I would think.
The rest of the diffs are stylistic and license text shortening except for these sections which are tied to the CSR addressing.

I apologize for the Very long delay here. Got stuck in some hairy support case combined with a 2 vacation back to the homeland in europe :)

Oh no worries! The "stale" label was just a memory for me and by no means a subtle trigger. 😅

Where I use hex for the mantissa encoding and you have changed it to a binary value... well that and I sim with xcelium and not ghdl.. but that shouldn't matter I would think.

I have no idea why I have changed that... Anyway, it should not matter at all.

The rest of the diffs are stylistic and license text shortening except for these sections which are tied to the CSR addressing.

I think I just moved some of the "coarse" CSR addressing logic out of the FPU. There should be no functional difference.

I hadn't even noticed the stale flag :) this bug as been on my mind for a while now. Its especially frustrating that I cannot recreate it in our ASIC sim environement.
I agree the addressing doesn't matter :) more a "this is the only major difference I see". Basically the diff tells me they 2 FPUs are essentially the same.
As for the hex vs non-hex encoding. The only difference I could see would be (and not I could have counted wrong) the hex version has 24 "0"s and the non-hex version only has 23 "0"s. Not sure if I remember the width of the mantessia at this stage. I thought it was 24-bits as we haven't post shifted anything yet.
Granted this should have resulted in a compile error as the left and right hand-side are different widths. This isn't verilog where different left and right hand sides are allowed.
Now my base core is still way old. I think my last sync point was sometime in February, beyond bug-fixes. As this is an FPU specific issue this shouldn't matter.
The good news is we haven't found issues in a quite a while :) I do need to update the RVVI as we've added full support for IRQ and started "punishing" the core with randomized IRQs. This btw. is super hard to make work, but the Imperas ISA has some fancy tricks up its sleeves to allow this to happen.
Next steps will be to try and recreate the environment with ghdl vs xcelium and do trace dump of the FPU to compare the internal state in the 2 cases. If all else fails it could be a tool issues. Super unlikely though.

I agree the addressing doesn't matter :) more a "this is the only major difference I see". Basically the diff tells me they 2 FPUs are essentially the same.

So you are comparing your local FPU with the one from the main branch, right?

As for the hex vs non-hex encoding.

Please note that the "fix" from #943 does not contain this mantissa = 0 check anymore (as part of the supposed "bug fix" triggered by #942).

Now my base core is still way old. I think my last sync point was sometime in February, beyond bug-fixes. As this is an FPU specific issue this shouldn't matter.

:+1:

The good news is we haven't found issues in a quite a while :)

That sounds great! So we can discard #943 as this seems so be "just" a toolchain/library issue? 🤔

I do need to update the RVVI as we've added full support for IRQ and started "punishing" the core with randomized IRQs. This btw. is super hard to make work, but the Imperas ISA has some fancy tricks up its sleeves to allow this to happen.

I'm very curious about the findings from this! I've tried feeding the core with permanent interrupt requests before (some of it is still available in the default processor check program), but I've never taken it to the extreme.


circle: define by top-left + diameter instead of center + radius

Hi! Thank you for helping out with Embedded Graphics development! Please:

[X] Check that you've added passing tests and documentation
[X] Add a simulator example(s) where applicable
[x] Add a CHANGELOG.md entry in the Unreleased section under the appropriate heading (Added, Fixed, etc) and appropriate crate (embedded-graphics, simulator, tinytga, tinybmp) if your changes affect the public API
[X] Run rustfmt on the project
[X] Run ./build.sh (Linux/macOS only) and make sure it passes. If you use Windows, check that CI passes once you've opened the PR.

PR description
This changes the API of Circle so that it is defined by top-left and diameter rather than by center and radius.
This is a breaking change. It should be 0.7.0 material.
This fixes #147

Awesome, thank you! I'll take a closer look at this once some more 0.6 stuff is over the line.

Great! If you want to continue working on this it would be nice to also have additional constructors and getters to replicate the old behavior:

Circle::with_center(center, diameter) -> Self
Circle::center(&self) -> Point

These methods would make drawing concentric circles easier.
The center point doesn't lie on an integer coordinate for all diameters, so these need to use some rounding. But the exact implementation will depend on #182, so IMO any close enough implementation would be OK and any off by one errors can be fixed later.

That's a good idea indeed.
Here you go.

This PR changes circle rendering slightly. Are we ok with that? The changelog should mention this as another breaking change, along with how circle definition has changed.

Here is an easier to compare rendering. Top row is current master with corresponding radius and bottom row is this PR with corresponding diameter.
Current master might look a bit better at radius 4 but a bit worse at radius 8, IMHO. Overall, I don't think it is a big deal...

Current master might look a bit better at radius 4 but a bit worse at radius 8, IMHO. Overall, I don't think it is a big deal...

Some circles look better, but I would prefer to not change the way circles look in this PR. Changing diameter_to_threshold to return diameter.pow(2) should make circles look like before.

Some circles look better, but I would prefer to not change the way circles look in this PR. Changing diameter_to_threshold to return diameter.pow(2) should make circles look like before.

OK. I tried with diameter.pow(2). The circles are identical to current master, except for diameter 3 and 5. See how it looks like:

So I modified this PR to usediameter.pow(2) except for small circles. This ensure all circles are identical to current master.

Nope, looks good to me. Thanks all!


System content message

Hi
first thanks for your work.
I'm using the OpenAi Api today and I'm facing problems with prompt size limitation.
So I test llama_index. During testing, I did not find how to add in the api  a"system content" message like
{"role": "system", "content":"You are a blog post summarization bot"
OpenAI wrote that the “system” content enhancing the response especially with gpt4
Is it possible to do this with the prompt customization?
Thanks for your help

:)
https://twitter.com/gpt_index/status/1639418614418907136/photo/1


Running the example code from Optimum documentation fails

Hello,
I was just trying to get the example code from optimum documentation up and running before I try to get an LLM to run on the NPU, but I keep getting this error: ImportError: cannot import name 'AutoQuantizationConfig' from 'optimum.amd.ryzenai'.
I checked the files and I can't find AutoQuantizationConfig class anywhere. I also checked the versions, and I am on the latest one (optimum - 1.17.1, optimum-amd - 0.1.0)

Hi @salembegic thank you for the report. Could you try from main?
pip uninstall optimum-amd
pip install git+https://github.com/huggingface/optimum-amd.git

Yep, that worked. Thanks for the help.
Just a quick question while I have you here. Is process the same if I wanted to run an LLM on the NPU (so export the model to onnx, quantize for the NPU, and then run), or are there any special steps?

@salembegic https://github.com/amd/RyzenAI-SW/tree/main/example/transformers dropped last week with an API exposed to PyTorch so it may be easier than going through ONNX + ORT.
We're also working to enable quantization through Brevitas & usage in ONNX but this is WIP.

Awaome, I'll check it out later today. Once again, thanks for the help😁😁.


I want modals to display when triggering not during OnInit

Hi,
i am trying to display a modals with a modal-trigger and not during OnInit, but every time when i start my application the modal pop-up directly.
Any help would be appreciated.
here's my component

import { Component, OnInit, OnChanges, EventEmitter, } from '@angular/core';
import { Location } from '@angular/common';
import { CompetenceService } from './../../core/services/competence-data.service';
import { Competence } from './../../models/competence';
import { Observable } from 'rxjs/Observable';
import { MaterializeAction } from 'angular2-materialize';
declare var $: any

@Component({
    selector: 'competence',
    templateUrl: './template/competence.html',
})

export class competenceComponent implements OnInit {
    competence: Competence;

    competenceliste: Observable<Array<Competence>>;

    constructor(private service: CompetenceService) { }

    ngOnInit() {
        this.competenceliste = this.service.GetFromCV();
    }

    modalActions = new EventEmitter<string | MaterializeAction>();
    openModal() {
        this.modalActions.emit({ action: "modal", params: ['open'] });
    }
    closeModal() {
        this.modalActions.emit({ action: "modal", params: ['close'] });
    }

    public modifcompetence() {
        this.service.Update(this.competence).subscribe();
        this.competence = null;
        this.competenceliste = this.service.GetFromCV();
    }

    delete(competence: Competence) {
        if (confirm("Voulez-vous vraiment supprimer cette compétence ?")) {
            this.service.Delete(competence).subscribe();
            this.competence = null;
            this.competenceliste = this.service.GetFromCV();
        }
    }

    updateButton(competence: Competence) {
        this.competence = competence;
    }
}

and here's my html

                        <button class="btn-floating btn-small waves-effect waves-light grey btnmodif modal-
                             trigger" (click)="openModal()">
                              mode_edit
                        </button>

Modifier une compétence

                        <input type="text" class="form-control" id="modifcompetence"
                               required
                               [(ngModel)]="competence.name" name="modifcompetence">
                        Nom

                        <input type="text" class="form-control" id="modifcompetence"
                               required
                               [(ngModel)]="competence.categorie" name="modifcompetence">
                        Catégorie

                    <button type="button" class="waves-effect waves-light btn grey">Annuler</button>
                    <button type="button" (click)="modifcompetence()" class="waves-effect waves-light
                           btn">Modifier</button>

Does this help? https://github.com/InfomediaLtd/angular2-materialize/issues/198#issuecomment-269328549

No unfortunately

Actually what I am trying to do is to bind a modal to a button and not from the code.

Isn't that exactly what this example does? http://angular2-materialize.surge.sh/#/Dialogs

Yes it the same, but for my case it doesn't work

Would you like to share a repo or paste the full example code? I'd first compare it to the sample code in this repo, to confirm the difference between your case and the vanilla one.

it worked finally, all i have to do is to add my object into my function call inside the modal trigger:
<button class="btn-floating btn-small waves-effect waves-light grey btnmodif modal-
trigger" (click)="openModal(competence)">
mode_edit


Change readme

just change readme for eo-kafka

@h1alexbel repo transfer

I will style the readme a bit later

@h1alexbel okay, thanks


Fix null reference exception for Streaming null object (#14004)

Description
In 2.2 we added Server-to-client streaming as well as the ability to accept a CancellationToken in your streaming hub methods so you can observe when the stream has been canceled by the client.
There is a bug where if the user provides null as one of the values to an argument to the hub method then we will nullref and return an error to the client.
Customer Impact
This was a customer reported issue.
If someone passes a null object (which is a valid scenario) to a streaming hub method that accepts a CancellationToken they will get a null ref on the server and the method will not be invoked.
Regression?
No, this has been a bug since the feature was introduced in 2.2.
Risk
Low, added test coverage to prevent this kind of issue in the future
@Pilchie I believe we need your approval for bug fixes

I presume our reasoning for only back-porting to 3.1 is that it's the LTS? Both 2.2 and 3.0 are "Current" releases, so we don't feel a need to back-port there because of the limited lifetime of those releases?

I presume our reasoning for only back-porting to 3.1 is that it's the LTS?

That was my reasoning

Approved.


Cannot move to file clicked in playground

Describe the bug
When I tried playing with the playground, it successfully generated some modules. But when I clicked on files on the left panel, the playground failed to navigate / open the file. I got stuck on the input file.
System: Windows 11
Browser: Chrome 120.0.6099.129
Expected Behaviour
Can click and see the generated file.
Code
NA

Logs

Hmm weird, I've only tested on Linux so far, but the path polyfill and browsers in general should never use backslashes in urls/paths 🤔
Gonna look into it

Should work now
monaco-editor used different path formats for windows user-agents

It works now, Thanks!


fix: remove unused build process

Closes #

Hi @qballer ,
Here are the details for claiming your Hacktoberfest prizes! 🎉 Check out #465  (comment) for more information or simply fill out the form here: Claim Your Swag.
Remember, you only need to fill out the form once for all your PRs. 😊


Need to install reader package before Run API codegen.

Need to install reader package before Run API codegen.

https://github.com/ansys/pyfluent/actions/runs/9889959134/job/27317176855?pr=3058

Not an issue